diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-13 01:59:33 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-13 01:59:33 +0000 |
commit | 1ddbc7e70f82b1b9c95869b2c9584a9c52526df2 (patch) | |
tree | ac88cf34998c512c00d20f29eb7d97e75a1937aa /lib | |
parent | 3a3d9ace577f2ace9ea682d8c7a7ecaf508b4182 (diff) |
merges r20686 from trunk into ruby_1_9_1.
Imported minitest 1.3.2 r4503.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/minitest/autorun.rb | 9 | ||||
-rw-r--r-- | lib/minitest/unit.rb | 12 |
2 files changed, 14 insertions, 7 deletions
diff --git a/lib/minitest/autorun.rb b/lib/minitest/autorun.rb new file mode 100644 index 0000000000..a9f9c67166 --- /dev/null +++ b/lib/minitest/autorun.rb @@ -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 diff --git a/lib/minitest/unit.rb b/lib/minitest/unit.rb index df6394a8eb..77176240c5 100644 --- a/lib/minitest/unit.rb +++ b/lib/minitest/unit.rb @@ -118,7 +118,7 @@ module MiniTest 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 @@ module MiniTest 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 @@ module MiniTest @@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 |