Fixed test_generated_site.
This commit is contained in:
parent
18b512a531
commit
d602600394
|
@ -5,19 +5,20 @@ class TestGeneratedSite < Test::Unit::TestCase
|
|||
setup do
|
||||
clear_dest
|
||||
@source = File.join(File.dirname(__FILE__), *%w[source])
|
||||
@s = Site.new(@source, dest_dir)
|
||||
@s.process
|
||||
@configuration = Jekyll.configuration 'source' => @source, 'destination' => dest_dir
|
||||
@site = Site.new(@configuration)
|
||||
@site.process
|
||||
@index = File.read(File.join(dest_dir, 'index.html'))
|
||||
end
|
||||
|
||||
should "insert site.posts into the index" do
|
||||
assert @index.include?("#{@s.posts.size} Posts")
|
||||
assert @index.include?("#{@site.posts.size} Posts")
|
||||
end
|
||||
|
||||
should "render post.content" do
|
||||
latest_post = Dir[File.join(@source, '_posts/*')].last
|
||||
post = Post.new(@source, '', File.basename(latest_post))
|
||||
Jekyll.content_type = post.determine_content_type
|
||||
post = Post.new(@site, @source, '', File.basename(latest_post))
|
||||
#Jekyll.content_type = post.determine_content_type
|
||||
post.transform
|
||||
assert @index.include?(post.content)
|
||||
end
|
||||
|
|
|
@ -30,13 +30,13 @@ class TestSite < Test::Unit::TestCase
|
|||
assert_equal 3, @s.categories['foo'].size
|
||||
end
|
||||
|
||||
should "filter entries" do
|
||||
ent1 = %w[foo.markdown bar.markdown baz.markdown #baz.markdown#
|
||||
.baz.markdow foo.markdown~]
|
||||
ent2 = %w[.htaccess _posts bla.bla]
|
||||
should "filter entries" do
|
||||
ent1 = %w[foo.markdown bar.markdown baz.markdown #baz.markdown#
|
||||
.baz.markdow foo.markdown~]
|
||||
ent2 = %w[.htaccess _posts bla.bla]
|
||||
|
||||
assert_equal %w[foo.markdown bar.markdown baz.markdown], @s.filter_entries(ent1)
|
||||
assert_equal ent2, @s.filter_entries(ent2)
|
||||
assert_equal %w[foo.markdown bar.markdown baz.markdown], @s.filter_entries(ent1)
|
||||
assert_equal ent2, @s.filter_entries(ent2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue