1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/core/exception/reason_spec.rb
2019-12-27 17:36:07 +01:00

13 lines
292 B
Ruby

require_relative '../../spec_helper'
describe "LocalJumpError#reason" do
def get_me_a_return
Proc.new { return 42 }
end
it "returns 'return' for a return" do
-> { get_me_a_return.call }.should raise_error(LocalJumpError) { |e|
e.reason.should == :return
}
end
end