mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Excerpt relative-path should match its path (#6597)
Merge pull request 6597
This commit is contained in:
@@ -78,6 +78,15 @@ class TestExcerpt < JekyllUnitTest
|
||||
end
|
||||
end
|
||||
|
||||
context "#relative_path" do
|
||||
should "return its document's relative path with '/#excerpt' appended" do
|
||||
assert_equal "#{@excerpt.doc.relative_path}/#excerpt",
|
||||
@excerpt.relative_path
|
||||
assert_equal "_posts/2013-07-22-post-excerpt-with-layout.markdown/#excerpt",
|
||||
@excerpt.relative_path
|
||||
end
|
||||
end
|
||||
|
||||
context "#to_liquid" do
|
||||
should "contain the proper page data to mimic the post liquid" do
|
||||
assert_equal "Post Excerpt with Layout", @excerpt.to_liquid["title"]
|
||||
@@ -86,7 +95,7 @@ class TestExcerpt < JekyllUnitTest
|
||||
assert_equal Time.parse("2013-07-22"), @excerpt.to_liquid["date"]
|
||||
assert_equal %w(bar baz z_category MixedCase), @excerpt.to_liquid["categories"]
|
||||
assert_equal %w(first second third jekyllrb.com), @excerpt.to_liquid["tags"]
|
||||
assert_equal "_posts/2013-07-22-post-excerpt-with-layout.markdown",
|
||||
assert_equal "_posts/2013-07-22-post-excerpt-with-layout.markdown/#excerpt",
|
||||
@excerpt.to_liquid["path"]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user