1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_weakmap.rb: fix test

* test/ruby/test_weakmap.rb (test_include?): create target object in a
  block, so that collected soon as possible.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-12-13 14:50:00 +00:00
parent 36e09fc28b
commit 537f327653

View file

@ -31,7 +31,8 @@ class TestWeakMap < Test::Unit::TestCase
def test_include?
m = __callee__[/test_(.*)/, 1]
k = "foo"
Object.new.tap do |x|
1.times do
x = Object.new
@wm[k] = x
assert_send([@wm, m, k])
assert_not_send([@wm, m, "FOO".downcase])