e2402c1
From 300c95eae0f833448e83b0fdb0a82866f53a26c4 Mon Sep 17 00:00:00 2001
8a80f8c
From: Fabio Valentini <decathorpe@gmail.com>
8f677fc
Date: Mon, 26 Aug 2019 10:31:44 +0200
e2402c1
Subject: [PATCH 4/8] tests/related_posts: disable tests requiring
8f677fc
 classifier-reborn
8a80f8c
8a80f8c
---
8a80f8c
 test/test_related_posts.rb | 66 --------------------------------------
8a80f8c
 1 file changed, 66 deletions(-)
8a80f8c
 delete mode 100644 test/test_related_posts.rb
8a80f8c
4c9f0fa
diff --git a/test/test_related_posts.rb b/test/test_related_posts.rb
4c9f0fa
deleted file mode 100644
5ef176f
index 7f9a978f1..000000000
4c9f0fa
--- a/test/test_related_posts.rb
4c9f0fa
+++ /dev/null
4c9f0fa
@@ -1,66 +0,0 @@
4c9f0fa
-# frozen_string_literal: true
4c9f0fa
-
4c9f0fa
-require "helper"
4c9f0fa
-
4c9f0fa
-class TestRelatedPosts < JekyllUnitTest
4c9f0fa
-  context "building related posts without lsi" do
4c9f0fa
-    setup do
4c9f0fa
-      @site = fixture_site
4c9f0fa
-    end
4c9f0fa
-
4c9f0fa
-    should "use the most recent posts for related posts" do
4c9f0fa
-      @site.reset
4c9f0fa
-      @site.read
4c9f0fa
-
4c9f0fa
-      last_post     = @site.posts.last
4c9f0fa
-      related_posts = Jekyll::RelatedPosts.new(last_post).build
4c9f0fa
-
4c9f0fa
-      last_ten_recent_posts = (@site.posts.docs.reverse - [last_post]).first(10)
4c9f0fa
-      assert_equal last_ten_recent_posts, related_posts
4c9f0fa
-    end
4c9f0fa
-  end
4c9f0fa
-
4c9f0fa
-  context "building related posts with LSI" do
4c9f0fa
-    setup do
4c9f0fa
-      if jruby?
4c9f0fa
-        skip(
4c9f0fa
-          "JRuby does not perform well with CExt, test disabled."
4c9f0fa
-        )
4c9f0fa
-      end
4c9f0fa
-
4c9f0fa
-      allow_any_instance_of(Jekyll::RelatedPosts).to receive(:display)
8f677fc
-      @site = fixture_site(
8f677fc
-        "lsi" => true
8f677fc
-      )
4c9f0fa
-
4c9f0fa
-      @site.reset
4c9f0fa
-      @site.read
4c9f0fa
-      require "classifier-reborn"
4c9f0fa
-      Jekyll::RelatedPosts.lsi = nil
4c9f0fa
-    end
4c9f0fa
-
4c9f0fa
-    should "index Jekyll::Post objects" do
4c9f0fa
-      @site.posts.docs = @site.posts.docs.first(1)
4c9f0fa
-      expect_any_instance_of(::ClassifierReborn::LSI).to \
4c9f0fa
-        receive(:add_item).with(kind_of(Jekyll::Document))
4c9f0fa
-      Jekyll::RelatedPosts.new(@site.posts.last).build_index
4c9f0fa
-    end
4c9f0fa
-
4c9f0fa
-    should "find related Jekyll::Post objects, given a Jekyll::Post object" do
4c9f0fa
-      post = @site.posts.last
4c9f0fa
-      allow_any_instance_of(::ClassifierReborn::LSI).to receive(:build_index)
4c9f0fa
-      expect_any_instance_of(::ClassifierReborn::LSI).to \
4c9f0fa
-        receive(:find_related).with(post, 11).and_return(@site.posts[-1..-9])
4c9f0fa
-
4c9f0fa
-      Jekyll::RelatedPosts.new(post).build
4c9f0fa
-    end
4c9f0fa
-
4c9f0fa
-    should "use LSI for the related posts" do
4c9f0fa
-      allow_any_instance_of(::ClassifierReborn::LSI).to \
4c9f0fa
-        receive(:find_related).and_return(@site.posts[-1..-9])
4c9f0fa
-      allow_any_instance_of(::ClassifierReborn::LSI).to receive(:build_index)
4c9f0fa
-
4c9f0fa
-      assert_equal @site.posts[-1..-9], Jekyll::RelatedPosts.new(@site.posts.last).build
4c9f0fa
-    end
4c9f0fa
-  end
4c9f0fa
-end
8a80f8c
-- 
e2402c1
2.39.1
8a80f8c