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

Imported minitest 4.7.5 (r8724)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ryan 2013-06-22 00:20:05 +00:00
parent a59e629868
commit c816f90e76
4 changed files with 23 additions and 17 deletions

View file

@ -1,3 +1,8 @@
Sat Jun 22 09:11:33 2013 Ryan Davis <ryand-ruby@zenspider.com>
* lib/minitest/*: Imported minitest 4.7.5 (r8724)
* test/minitest/*: ditto
Sat Jun 22 07:20:30 2013 Koichi Sasada <ko1@atdot.net>
* gc.c (gc_prof_set_heap_info, after_gc_sweep): call

View file

@ -142,9 +142,8 @@ class MiniTest::Spec < MiniTest::Unit::TestCase
}.last
end
@@describe_stack = []
def describe_stack # :nodoc:
@@describe_stack
Thread.current[:describe_stack] ||= []
end
##

View file

@ -738,7 +738,7 @@ module MiniTest
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:

View file

@ -293,18 +293,22 @@ class TestMiniTestStub < MiniTest::Unit::TestCase
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
t = Time.now.to_i
Time.stub :now, val_or_callable do
@tc.assert_equal 42, Time.now
end
@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::TestCase
def test_stub_block_args
@assertion_count += 1
synchronize do
t = Time.now.to_i
t = Time.now.to_i
Time.stub :now, lambda { |n| n * 2 } do
@tc.assert_equal 42, Time.now(21)
end
@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