Made a test more robust

Against changes of the `assert_separately` prologue code.
This commit is contained in:
Nobuyoshi Nakada 2020-02-07 13:50:20 +09:00
parent dedcf62b13
commit 6ed1a5e0e6
No known key found for this signature in database
GPG Key ID: 4BC7D6DF58D8DF60

View File

@ -2393,7 +2393,10 @@ class TestModule < Test::Unit::TestCase
def test_inspect_segfault def test_inspect_segfault
bug_10282 = '[ruby-core:65214] [Bug #10282]' bug_10282 = '[ruby-core:65214] [Bug #10282]'
assert_separately [], <<-RUBY assert_separately [], "#{<<~"begin;"}\n#{<<~'end;'}"
bug_10282 = "#{bug_10282}"
begin;
line = __LINE__ + 2
module ShallowInspect module ShallowInspect
def shallow_inspect def shallow_inspect
"foo" "foo"
@ -2410,9 +2413,9 @@ class TestModule < Test::Unit::TestCase
A.prepend InspectIsShallow A.prepend InspectIsShallow
expect = "#<Method: A(ShallowInspect)#inspect(shallow_inspect)() -:7>" expect = "#<Method: A(ShallowInspect)#inspect(shallow_inspect)() -:#{line}>"
assert_equal expect, A.new.method(:inspect).inspect, "#{bug_10282}" assert_equal expect, A.new.method(:inspect).inspect, bug_10282
RUBY end;
end end
def test_define_method_with_unbound_method def test_define_method_with_unbound_method