diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_settracefunc.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 7d7b672fd8..11384273df 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -1676,10 +1676,16 @@ class TestSetTraceFunc < Test::Unit::TestCase tmpdir = Dir.mktmpdir path = "#{tmpdir}/hola.rb" File.open(path, "w") { |f| f.write("raise") } - TracePoint.new(:raise){|tp| next if !target_thread?; events << [tp.event]}.enable{ + tp = TracePoint.new(:raise) {|tp| events << [tp.event] if target_thread?} + tp.enable{ load path rescue nil } assert_equal [[:raise]], events + events.clear + tp.enable{ + require path rescue nil + } + assert_equal [[:raise]], events ensure FileUtils.rmtree(tmpdir) end |