Add type attribute to Document instances (#7406)

Merge pull request 7406
This commit is contained in:
Ashwin Maroli
2019-05-16 21:14:39 +05:30
committed by jekyllbot
parent db2de73a0d
commit 49ffbbd4c7
4 changed files with 19 additions and 7 deletions

View File

@@ -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

View File

@@ -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