File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 37
37
-> { @s . rb_exc_raise ( runtime_error ) } . should raise_error ( RuntimeError , '42' )
38
38
end
39
39
40
- it "sets $! to the raised exception" do
40
+ it "sets $! to the raised exception when not rescuing from an another exception " do
41
41
runtime_error = RuntimeError . new '42'
42
42
runtime_error . set_backtrace [ ]
43
43
begin
44
- @s . rb_exc_raise ( runtime_error )
44
+ @s . rb_exc_raise ( runtime_error )
45
+ rescue
46
+ $!. should == runtime_error
47
+ end
48
+ end
49
+
50
+ it "sets $! to the raised exception when $! when rescuing from an another exception" do
51
+ runtime_error = RuntimeError . new '42'
52
+ runtime_error . set_backtrace [ ]
53
+ begin
54
+ begin
55
+ raise StandardError
56
+ rescue
57
+ @s . rb_exc_raise ( runtime_error )
58
+ end
45
59
rescue
46
60
$!. should == runtime_error
47
61
end
You can’t perform that action at this time.
0 commit comments