Add tests for using custom excerpt
This commit is contained in:
parent
069e70d1b3
commit
0113fea7a1
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
layout: ~
|
||||
excerpt: 'I can set a custom excerpt with *markdown*'
|
||||
---
|
||||
|
||||
This is not my excerpt.
|
||||
|
||||
Neither is this.
|
|
@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
should "ensure post count is as expected" do
|
||||
assert_equal 31, @site.posts.size
|
||||
assert_equal 32, @site.posts.size
|
||||
end
|
||||
|
||||
should "insert site.posts into the index" do
|
||||
|
|
|
@ -320,6 +320,21 @@ class TestPost < Test::Unit::TestCase
|
|||
assert !@post.excerpt.include?("---"), "does not contains separator"
|
||||
end
|
||||
end
|
||||
|
||||
context "with custom excerpt" do
|
||||
setup do
|
||||
file = "2013-04-11-custom-excerpt.markdown"
|
||||
@post.process(file)
|
||||
@post.read_yaml(@source, file)
|
||||
@post.transform
|
||||
end
|
||||
|
||||
should "use custom excerpt" do
|
||||
assert_equal("<p>I can set a custom excerpt with <em>markdown</em></p>", @post.excerpt)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue