diff --git a/test/ruby/test_basicinstructions.rb b/test/ruby/test_basicinstructions.rb index 7e57530d72..e93b339377 100644 --- a/test/ruby/test_basicinstructions.rb +++ b/test/ruby/test_basicinstructions.rb @@ -85,7 +85,9 @@ class TestBasicInstructions < Test::Unit::TestCase s = "OK" prev = nil 3.times do - assert_equal prev.object_id, (prev ||= /#{s}/o).object_id if prev + re = /#{s}/o + assert_same prev, re if prev + prev = re end end