summaryrefslogtreecommitdiff
path: root/spec/ruby/core/exception/exit_value_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/exception/exit_value_spec.rb')
-rw-r--r--spec/ruby/core/exception/exit_value_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/ruby/core/exception/exit_value_spec.rb b/spec/ruby/core/exception/exit_value_spec.rb
new file mode 100644
index 0000000000..bb6cff1831
--- /dev/null
+++ b/spec/ruby/core/exception/exit_value_spec.rb
@@ -0,0 +1,13 @@
+require_relative '../../spec_helper'
+
+describe "LocalJumpError#exit_value" do
+ def get_me_a_return
+ Proc.new { return 42 }
+ end
+
+ it "returns the value given to return" do
+ -> { get_me_a_return.call }.should.raise(LocalJumpError) { |e|
+ e.exit_value.should == 42
+ }
+ end
+end