Sha256: d204d8537bd052cc3fad4ea7371564878d85e346fd5dc358c090c4424b15605f
Contents?: true
Size: 1.26 KB
Versions: 2
Compression:
Stored size: 1.26 KB
Contents
require 'helper' class TestRelatedPosts < Test::Unit::TestCase context "building related posts without lsi" do setup do stub(Jekyll).configuration do Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir}) end @site = Site.new(Jekyll.configuration) end should "use the most recent posts for related posts" do @site.reset @site.read assert_equal @site.posts[0..9], Jekyll::RelatedPosts.new(@site.posts.last).build end end context "building related posts with lsi" do setup do stub(Jekyll).configuration do Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'lsi' => true}) end @site = Site.new(Jekyll.configuration) end should "use lsi for the related posts" do @site.reset @site.read require 'classifier' any_instance_of(::Classifier::LSI) do |c| stub(c).find_related { @site.posts[-1..-9] } stub(c).build_index end assert_equal @site.posts[-1..-9], Jekyll::RelatedPosts.new(@site.posts.last).build end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jekyll-1.0.4 | test/test_related_posts.rb |
jekyll-1.0.3 | test/test_related_posts.rb |