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

ruby-changes:29501

From: ryan <ko1@a...>
Date: Sat, 22 Jun 2013 09:20:16 +0900 (JST)
Subject: [ruby-changes:29501] ryan:r41553 (trunk): Imported minitest 4.7.5 (r8724)

ryan	2013-06-22 09:20:05 +0900 (Sat, 22 Jun 2013)

  New Revision: 41553

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

  Log:
    Imported minitest 4.7.5 (r8724)

  Modified files:
    trunk/ChangeLog
    trunk/lib/minitest/spec.rb
    trunk/lib/minitest/unit.rb
    trunk/test/minitest/test_minitest_mock.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41552)
+++ ChangeLog	(revision 41553)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jun 22 09:11:33 2013  Ryan Davis  <ryand-ruby@z...>
+
+	* lib/minitest/*: Imported minitest 4.7.5 (r8724)
+	* test/minitest/*: ditto
+
 Sat Jun 22 07:20:30 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (gc_prof_set_heap_info, after_gc_sweep): call
Index: lib/minitest/unit.rb
===================================================================
--- lib/minitest/unit.rb	(revision 41552)
+++ lib/minitest/unit.rb	(revision 41553)
@@ -738,7 +738,7 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/lib/minitest/unit.rb#L738
   end
 
   class Unit # :nodoc:
-    VERSION = "4.7.4" # :nodoc:
+    VERSION = "4.7.5" # :nodoc:
 
     attr_accessor :report, :failures, :errors, :skips # :nodoc:
     attr_accessor :assertion_count                    # :nodoc:
Index: lib/minitest/spec.rb
===================================================================
--- lib/minitest/spec.rb	(revision 41552)
+++ lib/minitest/spec.rb	(revision 41553)
@@ -142,9 +142,8 @@ class MiniTest::Spec < MiniTest::Unit::T https://github.com/ruby/ruby/blob/trunk/lib/minitest/spec.rb#L142
       }.last
     end
 
-    @@describe_stack = []
     def describe_stack # :nodoc:
-      @@describe_stack
+      Thread.current[:describe_stack] ||= []
     end
 
     ##
Index: test/minitest/test_minitest_mock.rb
===================================================================
--- test/minitest/test_minitest_mock.rb	(revision 41552)
+++ test/minitest/test_minitest_mock.rb	(revision 41553)
@@ -293,18 +293,22 @@ class TestMiniTestStub < MiniTest::Unit: https://github.com/ruby/ruby/blob/trunk/test/minitest/test_minitest_mock.rb#L293
     assert_equal @assertion_count, @tc._assertions
   end
 
+  class Time
+    def self.now
+      24
+    end
+  end
+
   def assert_stub val_or_callable
     @assertion_count += 1
 
-    synchronize do
-      t = Time.now.to_i
-
-      Time.stub :now, val_or_callable do
-        @tc.assert_equal 42, Time.now
-      end
+    t = Time.now.to_i
 
-      @tc.assert_operator Time.now.to_i, :>=, t
+    Time.stub :now, val_or_callable do
+      @tc.assert_equal 42, Time.now
     end
+
+    @tc.assert_operator Time.now.to_i, :>=, t
   end
 
   def test_stub_private_module_method
@@ -352,15 +356,13 @@ class TestMiniTestStub < MiniTest::Unit: https://github.com/ruby/ruby/blob/trunk/test/minitest/test_minitest_mock.rb#L356
   def test_stub_block_args
     @assertion_count += 1
 
-    synchronize do
-      t = Time.now.to_i
-
-      Time.stub :now,  lambda { |n| n * 2 } do
-        @tc.assert_equal 42, Time.now(21)
-      end
+    t = Time.now.to_i
 
-      @tc.assert_operator Time.now.to_i, :>=, t
+    Time.stub :now,  lambda { |n| n * 2 } do
+      @tc.assert_equal 42, Time.now(21)
     end
+
+    @tc.assert_operator Time.now.to_i, :>=, t
   end
 
   def test_stub_callable

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

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