mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Imported minitest 3.4.0 (r7762)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8ee2226068
commit
a3980eb2b6
4 changed files with 29 additions and 4 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Sep 6 08:20:55 2012 Ryan Davis <ryand-ruby@zenspider.com>
|
||||||
|
|
||||||
|
* lib/minitest/*: Imported minitest 3.4.0 (r7762)
|
||||||
|
* test/minitest/*: ditto
|
||||||
|
|
||||||
Wed Sep 5 19:20:53 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
Wed Sep 5 19:20:53 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (rb_warn4S): renamed from rb_warn4(), because the case in
|
* parse.y (rb_warn4S): renamed from rb_warn4(), because the case in
|
||||||
|
|
|
||||||
|
|
@ -315,6 +315,13 @@ the gem, but you'll need to activate the gem explicitly to use it:
|
||||||
|
|
||||||
# ... usual testing stuffs ...
|
# ... usual testing stuffs ...
|
||||||
|
|
||||||
|
DO NOTE: There is a serious problem with the way that ruby 1.9/2.0
|
||||||
|
packages their own gems. They install a gem specification file, but
|
||||||
|
don't install the gem contents in the gem path. This messes up
|
||||||
|
Gem.find_files and many other things (gem which, gem contents, etc).
|
||||||
|
|
||||||
|
Just install minitest as a gem for real and you'll be happier.
|
||||||
|
|
||||||
== LICENSE:
|
== LICENSE:
|
||||||
|
|
||||||
(The MIT License)
|
(The MIT License)
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,8 @@ module MiniTest
|
||||||
##
|
##
|
||||||
# Fails if stdout or stderr do not output the expected results.
|
# Fails if stdout or stderr do not output the expected results.
|
||||||
# Pass in nil if you don't care about that streams output. Pass in
|
# Pass in nil if you don't care about that streams output. Pass in
|
||||||
# "" if you require it to be silent.
|
# "" if you require it to be silent. Pass in a regexp if you want
|
||||||
|
# to pattern match.
|
||||||
#
|
#
|
||||||
# See also: #assert_silent
|
# See also: #assert_silent
|
||||||
|
|
||||||
|
|
@ -320,8 +321,11 @@ module MiniTest
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
|
|
||||||
y = assert_equal stderr, err, "In stderr" if stderr
|
err_msg = Regexp === stderr ? :assert_match : :assert_equal if stderr
|
||||||
x = assert_equal stdout, out, "In stdout" if stdout
|
out_msg = Regexp === stdout ? :assert_match : :assert_equal if stdout
|
||||||
|
|
||||||
|
y = send err_msg, stderr, err, "In stderr" if err_msg
|
||||||
|
x = send out_msg, stdout, out, "In stdout" if out_msg
|
||||||
|
|
||||||
(!stdout || x) && (!stderr || y)
|
(!stdout || x) && (!stderr || y)
|
||||||
end
|
end
|
||||||
|
|
@ -655,7 +659,7 @@ module MiniTest
|
||||||
end
|
end
|
||||||
|
|
||||||
class Unit # :nodoc:
|
class Unit # :nodoc:
|
||||||
VERSION = "3.3.0" # :nodoc:
|
VERSION = "3.4.0" # :nodoc:
|
||||||
|
|
||||||
attr_accessor :report, :failures, :errors, :skips # :nodoc:
|
attr_accessor :report, :failures, :errors, :skips # :nodoc:
|
||||||
attr_accessor :test_count, :assertion_count # :nodoc:
|
attr_accessor :test_count, :assertion_count # :nodoc:
|
||||||
|
|
|
||||||
|
|
@ -897,6 +897,15 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_assert_output_both_regexps
|
||||||
|
@assertion_count = 4
|
||||||
|
|
||||||
|
@tc.assert_output(/y.y/, /bl.h/) do
|
||||||
|
print "yay"
|
||||||
|
$stderr.print "blah"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_assert_output_err
|
def test_assert_output_err
|
||||||
@tc.assert_output nil, "blah" do
|
@tc.assert_output nil, "blah" do
|
||||||
$stderr.print "blah"
|
$stderr.print "blah"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue