diff options
Diffstat (limited to 'lib/minitest/unit.rb')
-rw-r--r-- | lib/minitest/unit.rb | 12 |
1 files changed, 5 insertions, 7 deletions
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 |