From e9dbafa5c89845ccde3b20fb8e1de4277afcdb53 Mon Sep 17 00:00:00 2001 From: normal Date: Wed, 28 Nov 2018 04:31:42 +0000 Subject: [PATCH] test_settracefunc (test_tracepoint_enable_with_target_line): less fragile Allow us to make other changes to the file and move the method around without affecting this test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_settracefunc.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index cb4c1cabc3..edbc1e9956 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -2059,6 +2059,7 @@ class TestSetTraceFunc < Test::Unit::TestCase def test_tracepoint_enable_with_target_line events = [] + line_0 = __LINE__ code1 = proc{ events << 1 events << 2 @@ -2067,7 +2068,7 @@ class TestSetTraceFunc < Test::Unit::TestCase tp = TracePoint.new(:line) do |tp| events << :tp end - tp.enable(target: code1, target_line: 2064) do + tp.enable(target: code1, target_line: line_0 + 3) do code1.call end assert_equal [1, :tp, 2, 3], events