Fix tests to match new behaviour of Pager.paginate_path

This commit is contained in:
Parker Moore 2013-06-09 21:09:06 +02:00
parent 7dc6767bc9
commit 7f10b32431
1 changed files with 10 additions and 6 deletions

View File

@ -6,7 +6,7 @@ class TestPager < Test::Unit::TestCase
base = Jekyll::Configuration::DEFAULTS.deep_merge({ base = Jekyll::Configuration::DEFAULTS.deep_merge({
'source' => source_dir, 'source' => source_dir,
'destination' => dest_dir, 'destination' => dest_dir,
'pagination' => 1 'paginate' => 1
}) })
site = Jekyll::Site.new(base.deep_merge(config)) site = Jekyll::Site.new(base.deep_merge(config))
site.process site.process
@ -23,12 +23,16 @@ class TestPager < Test::Unit::TestCase
end end
should "determine the pagination path" do should "determine the pagination path" do
#assert_equal("/index.html", Pager.paginate_path(build_site, 1)) assert_equal("/index.html", Pager.paginate_path(build_site, 1))
assert_equal("/page2", Pager.paginate_path(build_site, 2)) assert_equal("/page2", Pager.paginate_path(build_site, 2))
#assert_equal("/index.html", Pager.paginate_path(build_site('paginate_path' => '/blog/page-:num'), 1)) assert_equal("/index.html", Pager.paginate_path(build_site({'paginate_path' => '/blog/page-:num'}), 1))
assert_equal("/blog/page-2", Pager.paginate_path(build_site('paginate_path' => '/blog/page-:num'), 2)) assert_equal("/blog/page-2", Pager.paginate_path(build_site({'paginate_path' => '/blog/page-:num'}), 2))
#assert_equal("/index.html", Pager.paginate_path(build_site('paginate_path' => '/blog/page/:num'), 1)) assert_equal("/index.html", Pager.paginate_path(build_site({'paginate_path' => '/blog/page/:num'}), 1))
assert_equal("/blog/page/2", Pager.paginate_path(build_site('paginate_path' => '/blog/page/:num'), 2)) assert_equal("/blog/page/2", Pager.paginate_path(build_site({'paginate_path' => '/blog/page/:num'}), 2))
assert_equal("/contacts/index.html", Pager.paginate_path(build_site({'paginate_path' => '/contacts/page:num'}), 1))
assert_equal("/contacts/page2", Pager.paginate_path(build_site({'paginate_path' => '/contacts/page:num'}), 2))
assert_equal("/contacts/index.html", Pager.paginate_path(build_site({'paginate_path' => '/contacts/page/:num'}), 1))
assert_equal("/contacts/page/2", Pager.paginate_path(build_site({'paginate_path' => '/contacts/page/:num'}), 2))
end end
context "pagination disabled" do context "pagination disabled" do