diff options
Diffstat (limited to 'spec/ruby/core/exception/success_spec.rb')
| -rw-r--r-- | spec/ruby/core/exception/success_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/ruby/core/exception/success_spec.rb b/spec/ruby/core/exception/success_spec.rb new file mode 100644 index 0000000000..5ab8f94454 --- /dev/null +++ b/spec/ruby/core/exception/success_spec.rb @@ -0,0 +1,15 @@ +require_relative '../../spec_helper' + +describe "SystemExit#success?" do + it "returns true if the process exited successfully" do + -> { exit 0 }.should.raise(SystemExit) { |e| + e.should.success? + } + end + + it "returns false if the process exited unsuccessfully" do + -> { exit(-1) }.should.raise(SystemExit) { |e| + e.should_not.success? + } + end +end |
