ruby-changes:24864
From: ryan <ko1@a...>
Date: Thu, 6 Sep 2012 08:25:28 +0900 (JST)
Subject: [ruby-changes:24864] ryan:r36914 (trunk): Imported minitest 3.4.0 (r7762)
ryan 2012-09-06 08:24:58 +0900 (Thu, 06 Sep 2012) New Revision: 36914 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36914 Log: Imported minitest 3.4.0 (r7762) Modified files: trunk/ChangeLog trunk/lib/minitest/README.txt trunk/lib/minitest/unit.rb trunk/test/minitest/test_minitest_unit.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 36913) +++ ChangeLog (revision 36914) @@ -1,3 +1,8 @@ +Thu Sep 6 08:20:55 2012 Ryan Davis <ryand-ruby@z...> + + * lib/minitest/*: Imported minitest 3.4.0 (r7762) + * test/minitest/*: ditto + Wed Sep 5 19:20:53 2012 NAKAMURA Usaku <usa@r...> * parse.y (rb_warn4S): renamed from rb_warn4(), because the case in Index: lib/minitest/unit.rb =================================================================== --- lib/minitest/unit.rb (revision 36913) +++ lib/minitest/unit.rb (revision 36914) @@ -311,7 +311,8 @@ ## # 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 - # "" 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 @@ -320,9 +321,12 @@ yield end - y = assert_equal stderr, err, "In stderr" if stderr - x = assert_equal stdout, out, "In stdout" if stdout + err_msg = Regexp === stderr ? :assert_match : :assert_equal if stderr + 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) end @@ -655,7 +659,7 @@ end class Unit # :nodoc: - VERSION = "3.3.0" # :nodoc: + VERSION = "3.4.0" # :nodoc: attr_accessor :report, :failures, :errors, :skips # :nodoc: attr_accessor :test_count, :assertion_count # :nodoc: Index: lib/minitest/README.txt =================================================================== --- lib/minitest/README.txt (revision 36913) +++ lib/minitest/README.txt (revision 36914) @@ -315,6 +315,13 @@ # ... 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: (The MIT License) Index: test/minitest/test_minitest_unit.rb =================================================================== --- test/minitest/test_minitest_unit.rb (revision 36913) +++ test/minitest/test_minitest_unit.rb (revision 36914) @@ -897,6 +897,15 @@ 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 @tc.assert_output nil, "blah" do $stderr.print "blah" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/