mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Add type attribute to Document instances (#7406)
Merge pull request 7406
This commit is contained in:
@@ -58,6 +58,10 @@ class TestDocument < JekyllUnitTest
|
||||
assert_equal "configuration", @document.basename_without_ext
|
||||
end
|
||||
|
||||
should "know its type" do
|
||||
assert_equal :methods, @document.type
|
||||
end
|
||||
|
||||
should "know whether it's a YAML file" do
|
||||
assert_equal false, @document.yaml_file?
|
||||
end
|
||||
|
||||
@@ -56,6 +56,15 @@ class TestExcerpt < JekyllUnitTest
|
||||
end
|
||||
end
|
||||
|
||||
context "#type" do
|
||||
should "return the post's type" do
|
||||
assert_equal @excerpt.type, @post.type
|
||||
end
|
||||
should "return a symbol" do
|
||||
assert_same @excerpt.type.class, Symbol
|
||||
end
|
||||
end
|
||||
|
||||
context "#to_s" do
|
||||
should "return rendered output" do
|
||||
assert_equal @excerpt.output, @excerpt.to_s
|
||||
|
||||
Reference in New Issue
Block a user