[前][次][番号順一覧][スレッド一覧]

ruby-changes:34353

From: nobu <ko1@a...>
Date: Sun, 15 Jun 2014 08:13:55 +0900 (JST)
Subject: [ruby-changes:34353] nobu:r46434 (trunk): runner.rb: use class variable

nobu	2014-06-15 08:13:50 +0900 (Sun, 15 Jun 2014)

  New Revision: 46434

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46434

  Log:
    runner.rb: use class variable
    
    * test/runner.rb (after_teardown): turn zombie traces hash into a
      class variable.

  Modified files:
    trunk/test/runner.rb
Index: test/runner.rb
===================================================================
--- test/runner.rb	(revision 46433)
+++ test/runner.rb	(revision 46434)
@@ -19,15 +19,16 @@ require_relative 'profile_test_all' if E https://github.com/ruby/ruby/blob/trunk/test/runner.rb#L19
 
 module Test::Unit
   module ZombieHunter
+    @@zombie_traces = Hash.new(0)
+
     def after_teardown
       super
       assert_empty(Process.waitall)
 
       # detect zombie traces.
-      zombie_traces = Hash.new(0)
       TracePoint.stat.each{|key, (activated, deleted)|
-        old, zombie_traces[key] = zombie_traces[key], activated
-        assert_equal(old, activated, "The number of active trace events (#{key}) should not increase.")
+        old, @@zombie_traces[key] = @@zombie_traces[key], activated
+        assert_equal(old, activated, "The number of active trace events (#{key}) should not increase")
         # puts "TracePoint - deleted: #{deleted}" if deleted > 0
       }
     end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]