Skip to content

Commit

Permalink
Allow for --timeout=-1
Browse files Browse the repository at this point in the history
  • Loading branch information
oleander committed Jun 10, 2016
1 parent e39fbf9 commit fde4354
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/git-fame
Expand Up @@ -28,7 +28,7 @@ unless GitFame::SORT.include?(opts[:sort])
Trollop::die :sort, "must be one of the following; #{GitFame::SORT.join(", ")}"
end

if opts[:timeout] <= 0
if opts[:timeout] != -1 and opts[:timeout] <= 0
Trollop::die :timeout, "must be positive"
end

Expand Down
5 changes: 3 additions & 2 deletions spec/bin_spec.rb
Expand Up @@ -34,7 +34,8 @@
"--help",
"--verbose",
"--everything",
"--timeout=10"
"--timeout=10",
"--timeout=-1"
].each do |option|
it "should support #{option}" do
run(option).should be_a_succees
Expand Down Expand Up @@ -67,8 +68,8 @@
it "should fail on invalid timeout" do
run("--timeout=hello").should_not be_a_succees
run("--timeout=").should_not be_a_succees
run("--timeout=-1").should_not be_a_succees
run("--timeout=0").should_not be_a_succees
run("--timeout=-2").should_not be_a_succees
end

it "should not print stack trace on invalid dates (--before)" do
Expand Down

0 comments on commit fde4354

Please sign in to comment.