summaryrefslogtreecommitdiff
path: root/spec/ruby/core/exception/success_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/exception/success_spec.rb')
-rw-r--r--spec/ruby/core/exception/success_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/ruby/core/exception/success_spec.rb b/spec/ruby/core/exception/success_spec.rb
index 82e3df92c6..5ab8f94454 100644
--- a/spec/ruby/core/exception/success_spec.rb
+++ b/spec/ruby/core/exception/success_spec.rb
@@ -1,5 +1,15 @@
require_relative '../../spec_helper'
describe "SystemExit#success?" do
- it "needs to be reviewed for spec completeness"
+ 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