Merge pull request #5652 from jekyll/pull/assert_nil

Merge pull request 5652
This commit is contained in:
jekyllbot 2016-12-10 12:16:59 -08:00 committed by GitHub
commit b6b0fdc05b
4 changed files with 10 additions and 6 deletions

View File

@ -206,7 +206,7 @@ class TestDocument < JekyllUnitTest
should "not know the specified front matter defaults" do
assert_equal "Example slide", @document.data["title"]
assert_equal "slide", @document.data["layout"]
assert_equal nil, @document.data["nested"]
assert_nil @document.data["nested"]
end
end

View File

@ -96,9 +96,13 @@ class TestPage < JekyllUnitTest
attrs.each do |attr, val|
attr_str = attr.to_s
result = page[attr_str]
if val.nil?
assert_nil result, "For <page[\"#{attr_str}\"]>:"
else
assert_equal val, result, "For <page[\"#{attr_str}\"]>:"
end
end
end
context "with pretty permalink style" do
setup do
@ -220,7 +224,7 @@ class TestPage < JekyllUnitTest
should "return nil permalink if no permalink exists" do
@page = setup_page("")
assert_equal nil, @page.permalink
assert_nil @page.permalink
end
should "not be writable outside of destination" do

View File

@ -57,7 +57,7 @@ class TestStaticFile < JekyllUnitTest
should "have a destination relative directory without a collection" do
static_file = setup_static_file("root", "dir/subdir", "file.html")
assert_equal nil, static_file.type
assert_nil static_file.type
assert_equal "dir/subdir/file.html", static_file.url
assert_equal "dir/subdir", static_file.destination_rel_dir
end

View File

@ -47,11 +47,11 @@ class TestTheme < JekyllUnitTest
end
should "not allow paths outside of the theme root" do
assert_equal nil, @theme.send(:path_for, "../../source")
assert_nil @theme.send(:path_for, "../../source")
end
should "return nil for paths that don't exist" do
assert_equal nil, @theme.send(:path_for, "foo")
assert_nil @theme.send(:path_for, "foo")
end
should "return the resolved path when a symlink & resolved path exists" do