2015-12-16 00:07:31 -05:00
|
|
|
# frozen_string_literal: false
|
2013-02-08 02:09:48 -05:00
|
|
|
require 'test/unit'
|
|
|
|
|
|
|
|
module Bug
|
|
|
|
class Bug7802 < RuntimeError
|
|
|
|
end
|
|
|
|
|
2018-03-13 02:29:02 -04:00
|
|
|
class Test_ExceptionE < Test::Unit::TestCase
|
2013-02-08 02:09:48 -05:00
|
|
|
def test_ensured
|
|
|
|
assert_separately([], <<-'end;') # do
|
|
|
|
|
|
|
|
require '-test-/exception'
|
|
|
|
|
|
|
|
module Bug
|
|
|
|
class Bug7802 < RuntimeError
|
|
|
|
def try_method
|
|
|
|
raise self
|
|
|
|
end
|
|
|
|
|
|
|
|
def ensured_method
|
|
|
|
[1].detect {|i| true}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
assert_raise(Bug::Bug7802, '[ruby-core:52022] [Bug #7802]') {
|
|
|
|
Bug::Exception.ensured(Bug::Bug7802.new)
|
|
|
|
}
|
|
|
|
end;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|