You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/kernel/raise_spec.rb
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -240,6 +240,25 @@
240
240
end
241
241
end
242
242
243
+
it"re-raises a previously rescued exception that doesn't have a cause and is a cause of other exception (that wasn't raised explicitly) without setting a cause implicitly"do
244
+
begin
245
+
begin
246
+
raise"Error 1"
247
+
rescue=>e1
248
+
begin
249
+
foo# raises NameError
250
+
rescue=>e2
251
+
e1.cause.should == nil
252
+
e2.cause.should == e1
253
+
raisee1
254
+
end
255
+
end
256
+
rescue=>e
257
+
e.should == e1
258
+
e.cause.should == nil
259
+
end
260
+
end
261
+
243
262
it"re-raises a previously rescued exception that has a cause but isn't a cause of any other exception without setting a cause implicitly"do
0 commit comments