[rubygems/rubygems] Use a constant empty tar header to avoid extra allocations
[ruby.git] / test / -ext- / test_bug-5832.rb
blob986a3706d807ce65ca3cb6028615244b0bb24395
1 # frozen_string_literal: false
2 require '-test-/bug_5832'
4 class Test_BUG_5832 < Test::Unit::TestCase
5   def test_block_passing
6     bug5832 = '[ruby-dev:45071]'
8     c = Class.new do
9       define_method(:call_invoke_block_from_c) do
10         Bug.funcall_callback(self)
11       end
13       def callback
14         yield if block_given?
15       end
16     end
18     assert_nothing_raised(RuntimeError, bug5832) do
19       c.new.call_invoke_block_from_c { raise 'unreachable' }
20     end
21   end
22 end