Debian Codegraph @

test/-ext-/exception/test_ensured.rb

raw
1 # frozen_string_literal: false
2 require 'test/unit'
3
4 module Bug
5 class Bug7802 < RuntimeError
6 end
7
8 class Test_ExceptionE < Test::Unit::TestCase
9 def test_ensured
10 assert_separately([], <<-'end;') # do
11
12 require '-test-/exception'
13
14 module Bug
15 class Bug7802 < RuntimeError
16 def try_method
17 raise self
18 end
19
20 def ensured_method
21 [1].detect {|i| true}
22 end
23 end
24 end
25
26 assert_raise(Bug::Bug7802, '[ruby-core:52022] [Bug #7802]') {
27 Bug::Exception.ensured(Bug::Bug7802.new)
28 }
29 end;
30 end
31 end
32 end