1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/-ext-/test_threadswitch_hook.rb
knu 2fa4652028 * test/-ext-/test_threadswitch_hook.rb
(Test_ThreadSwitch#test_threadswitch_init): This test does not
  pass because the hook method actually calls rb_add_event_hook()
  which does not emit a warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@37221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 08:55:11 +00:00

16 lines
450 B
Ruby

require 'test/unit'
require '-test-/threadswitch/event_hook'
require 'ruby/envutil'
class Test_ThreadSwitch < Test::Unit::TestCase
def test_threadswitch_init
threads = []
warning = EnvUtil.verbose_warning {
EventHook::ThreadSwitch.hook {|name, thread|
threads << thread if name == "thread-init"
}
}
#assert_match(/not an official API/, warning)
assert_operator(threads, :include?, Thread.current)
end
end