Imported minitest 1.3.2 r4503.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ryan 2008-12-13 00:22:31 +00:00
Родитель 0e0c53a092
Коммит ac6024f522
4 изменённых файлов: 22 добавлений и 9 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Sat Dec 13 09:17:33 2008 Ryan Davis <ryand-ruby@zenspider.com>
* 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@dotrb.org>
* complex.c (nucomp_canonicalization): renamed.

9
lib/minitest/autorun.rb Normal file
Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -69,9 +69,9 @@ class TestMiniTest < MiniTest::Unit::TestCase
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