Add test for Page#dir in :date/nil modes
This commit is contained in:
parent
9daebe8dd2
commit
b1868983c7
|
@ -150,6 +150,12 @@ class TestPage < JekyllUnitTest
|
||||||
assert_equal '/contacts.html', @page.url
|
assert_equal '/contacts.html', @page.url
|
||||||
assert_equal @dest_file, @page.destination(dest_dir)
|
assert_equal @dest_file, @page.destination(dest_dir)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "return dir correctly" do
|
||||||
|
assert_equal '/', setup_page('contacts.html').dir
|
||||||
|
assert_equal '/contacts/', setup_page('contacts/bar.html').dir
|
||||||
|
assert_equal '/contacts/', setup_page('contacts/index.html').dir
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with custom permalink style with trailing slash" do
|
context "with custom permalink style with trailing slash" do
|
||||||
|
@ -194,8 +200,9 @@ class TestPage < JekyllUnitTest
|
||||||
context "with any other permalink style" do
|
context "with any other permalink style" do
|
||||||
should "return dir correctly" do
|
should "return dir correctly" do
|
||||||
@site.permalink_style = nil
|
@site.permalink_style = nil
|
||||||
@page = setup_page('contacts.html')
|
assert_equal '/', setup_page('contacts.html').dir
|
||||||
assert_equal '/', @page.dir
|
assert_equal '/contacts/', setup_page('contacts/index.html').dir
|
||||||
|
assert_equal '/contacts/', setup_page('contacts/bar.html').dir
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue