ruby-changes:32095
From: nobu <ko1@a...>
Date: Fri, 13 Dec 2013 22:29:12 +0900 (JST)
Subject: [ruby-changes:32095] nobu:r44174 (trunk): test_weakmap.rb: fix test
nobu 2013-12-13 22:29:07 +0900 (Fri, 13 Dec 2013) New Revision: 44174 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44174 Log: test_weakmap.rb: fix test * test/ruby/test_weakmap.rb (test_include?): isolate weak referenced object. Modified files: trunk/test/ruby/test_weakmap.rb Index: test/ruby/test_weakmap.rb =================================================================== --- test/ruby/test_weakmap.rb (revision 44173) +++ test/ruby/test_weakmap.rb (revision 44174) @@ -30,12 +30,13 @@ class TestWeakMap < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_weakmap.rb#L30 def test_include? m = __callee__[/test_(.*)/, 1] - x = Object.new k = "foo" - @wm[k] = x - assert_send([@wm, m, k]) - assert_not_send([@wm, m, "FOO".downcase]) - x = nil + Object.new do |x| + @wm[k] = x + assert_send([@wm, m, k]) + assert_not_send([@wm, m, "FOO".downcase]) + x = nil + end GC.start assert_not_send([@wm, m, k]) end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/