ruby-changes:9149
From: ryan <ko1@a...>
Date: Sat, 13 Dec 2008 09:22:54 +0900 (JST)
Subject: [ruby-changes:9149] Ruby:r20686 (trunk): Imported minitest 1.3.2 r4503.
ryan 2008-12-13 09:22:31 +0900 (Sat, 13 Dec 2008) New Revision: 20686 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20686 Log: Imported minitest 1.3.2 r4503. Added files: trunk/lib/minitest/autorun.rb Modified files: trunk/ChangeLog trunk/lib/minitest/unit.rb trunk/test/minitest/test_mini_test.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 20685) +++ ChangeLog (revision 20686) @@ -1,3 +1,9 @@ +Sat Dec 13 09:17:33 2008 Ryan Davis <ryand-ruby@z...> + + * lib/minitest/*.rb: Imported minitest 1.3.2 r4503. + * test/minitest/test_mini_test.rb: ditto. + * lib/miniunit/autorun.rb: added (as part of r4503). + Sat Dec 13 08:35:14 2008 Tadayoshi Funaba <tadf@d...> * complex.c (nucomp_canonicalization): renamed. Index: lib/minitest/autorun.rb =================================================================== --- lib/minitest/autorun.rb (revision 0) +++ lib/minitest/autorun.rb (revision 20686) @@ -0,0 +1,9 @@ +############################################################ +# This file is imported from a different project. +# DO NOT make modifications in this repo. +# File a patch instead and assign it to Ryan Davis +############################################################ + +require 'minitest/unit' + +MiniTest::Unit.autorun Index: lib/minitest/unit.rb =================================================================== --- lib/minitest/unit.rb (revision 20685) +++ lib/minitest/unit.rb (revision 20686) @@ -118,7 +118,7 @@ def assert_match exp, act, msg = nil msg = message(msg) { "Expected #{mu_pp(act)} to match #{mu_pp(exp)}" } assert_respond_to act, :"=~" - (exp = /#{exp}/) if String === exp && String === act + (exp = /#{Regexp.escape(exp)}/) if String === exp && String === act assert act =~ exp, msg end @@ -313,7 +313,7 @@ end class Unit - VERSION = "1.3.1" + VERSION = "1.3.2" attr_accessor :report, :failures, :errors, :skips attr_accessor :test_count, :assertion_count @@ -321,16 +321,14 @@ @@installed_at_exit ||= false @@out = $stdout - def self.disable_autorun - @@installed_at_exit = true - end - def self.autorun at_exit { +p $! + return if $! # don't run if there was an exception exit_code = MiniTest::Unit.new.run(ARGV) exit false if exit_code && exit_code != 0 } unless @@installed_at_exit - disable_autorun + @@installed_at_exit = true end def self.output= stream Index: test/minitest/test_mini_test.rb =================================================================== --- test/minitest/test_mini_test.rb (revision 20685) +++ test/minitest/test_mini_test.rb (revision 20686) @@ -69,9 +69,9 @@ end def test_filter_backtrace_all_unit - bt = (["./lib/mini/test.rb:165:in `__send__'"] + + bt = (["#{MINITEST_BASE_DIR}/test.rb:165:in `__send__'"] + BT_MIDDLE + - ["./lib/mini/test.rb:29"]) + ["#{MINITEST_BASE_DIR}/test.rb:29"]) ex = bt.clone fu = MiniTest::filter_backtrace(bt) assert_equal ex, fu -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/