forked from benhoskings/babushka
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return the command's exit code from Shell#result, not a boolean like …
…#ok?.
- Loading branch information
1 parent
1c05010
commit d68594a
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'spec_helper' | ||
|
||
describe Shell, '#ok?' do | ||
it "should return true on success" do | ||
Shell.new('true', {}).run(&:ok?).should be_true | ||
end | ||
it "should return false on failure" do | ||
Shell.new('false', {}).run(&:ok?).should be_false | ||
end | ||
end | ||
|
||
describe Shell, '#result' do | ||
it "should return zero on success" do | ||
Shell.new('true', {}).run(&:result).should == 0 | ||
end | ||
it "should return non-zero on failure" do | ||
Shell.new('false', {}).run(&:result).should == 1 | ||
end | ||
end |