summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb
index 0a6f9b2..3d0a04f 100644
--- a/spec/mixlib/shellout_spec.rb
+++ b/spec/mixlib/shellout_spec.rb
@@ -750,6 +750,24 @@ describe Mixlib::ShellOut do
lambda { executed_cmd.invalid!("I expected this to exit 42, not 0") }.should raise_error(Mixlib::ShellOut::ShellCommandFailed)
end
end
+
+ describe "#error?" do
+ context 'when exiting with invalid code' do
+ let(:exit_code) { 2 }
+
+ it "should return true" do
+ executed_cmd.error?.should be_true
+ end
+ end
+
+ context 'when exiting with valid code' do
+ let(:exit_code) { 0 }
+
+ it "should return false" do
+ executed_cmd.error?.should be_false
+ end
+ end
+ end
end
context "when handling the subprocess" do