Skip to content

Commit 76afd2d

Browse files
committed
Improve rb_rescue2 spec
(cherry picked from commit 9e9de91)
1 parent 0079332 commit 76afd2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/ruby/optional/capi/kernel_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,12 @@ def proc_caller
396396
proc = -> x { x }
397397
arg_error_proc = -> *_ { raise ArgumentError, '' }
398398
run_error_proc = -> *_ { raise RuntimeError, '' }
399-
type_error_proc = -> *_ { raise TypeError, '' }
399+
type_error_proc = -> *_ { raise Exception, 'custom error' }
400400
@s.rb_rescue2(arg_error_proc, :no_exc, proc, :exc, ArgumentError, RuntimeError).should == :exc
401401
@s.rb_rescue2(run_error_proc, :no_exc, proc, :exc, ArgumentError, RuntimeError).should == :exc
402402
-> {
403403
@s.rb_rescue2(type_error_proc, :no_exc, proc, :exc, ArgumentError, RuntimeError)
404-
}.should raise_error(TypeError)
404+
}.should raise_error(Exception, 'custom error')
405405
end
406406
end
407407

0 commit comments

Comments
 (0)