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:
normal 2018-11-28 04:31:42 +00:00
Родитель 79dd244c3a
Коммит e9dbafa5c8
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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