Change default value of limit_posts from nil to 0 (see #1004)

Before this commit meaning of limit_posts:
  nil: no limit. generate all posts
  0: raise error
  n ( > 0): generate n posts only
  n ( < 0): raise error
  else: raise error

After this commit:
  nil: same as 0
  0: no limit. generate all posts
  n ( > 0): generate n posts only
  n ( < 0): raise error
  else: almost same as 0 (depend on `to_i` result)
This commit is contained in:
uu59
2013-04-29 01:41:22 +09:00
parent ad2c706a34
commit 20a837d15c
3 changed files with 7 additions and 7 deletions

View File

@@ -58,11 +58,11 @@ class TestGeneratedSite < Test::Unit::TestCase
assert_equal 5, @site.posts.size
end
should "ensure limit posts is 1 or more" do
should "ensure limit posts is 0 or more" do
assert_raise ArgumentError do
clear_dest
stub(Jekyll).configuration do
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 0})
Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => -1})
end
@site = Site.new(Jekyll.configuration)