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
This commit is contained in:
parent
79dd244c3a
commit
e9dbafa5c8
@ -2059,6 +2059,7 @@ class TestSetTraceFunc < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_tracepoint_enable_with_target_line
|
def test_tracepoint_enable_with_target_line
|
||||||
events = []
|
events = []
|
||||||
|
line_0 = __LINE__
|
||||||
code1 = proc{
|
code1 = proc{
|
||||||
events << 1
|
events << 1
|
||||||
events << 2
|
events << 2
|
||||||
@ -2067,7 +2068,7 @@ class TestSetTraceFunc < Test::Unit::TestCase
|
|||||||
tp = TracePoint.new(:line) do |tp|
|
tp = TracePoint.new(:line) do |tp|
|
||||||
events << :tp
|
events << :tp
|
||||||
end
|
end
|
||||||
tp.enable(target: code1, target_line: 2064) do
|
tp.enable(target: code1, target_line: line_0 + 3) do
|
||||||
code1.call
|
code1.call
|
||||||
end
|
end
|
||||||
assert_equal [1, :tp, 2, 3], events
|
assert_equal [1, :tp, 2, 3], events
|
||||||
|
Loading…
x
Reference in New Issue
Block a user