mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
0e0c53a092
commit
ac6024f522
4 changed files with 22 additions and 9 deletions
|
@ -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>
|
Sat Dec 13 08:35:14 2008 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
* complex.c (nucomp_canonicalization): renamed.
|
* complex.c (nucomp_canonicalization): renamed.
|
||||||
|
|
9
lib/minitest/autorun.rb
Normal file
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
|
def assert_match exp, act, msg = nil
|
||||||
msg = message(msg) { "Expected #{mu_pp(act)} to match #{mu_pp(exp)}" }
|
msg = message(msg) { "Expected #{mu_pp(act)} to match #{mu_pp(exp)}" }
|
||||||
assert_respond_to act, :"=~"
|
assert_respond_to act, :"=~"
|
||||||
(exp = /#{exp}/) if String === exp && String === act
|
(exp = /#{Regexp.escape(exp)}/) if String === exp && String === act
|
||||||
assert act =~ exp, msg
|
assert act =~ exp, msg
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ module MiniTest
|
||||||
end
|
end
|
||||||
|
|
||||||
class Unit
|
class Unit
|
||||||
VERSION = "1.3.1"
|
VERSION = "1.3.2"
|
||||||
|
|
||||||
attr_accessor :report, :failures, :errors, :skips
|
attr_accessor :report, :failures, :errors, :skips
|
||||||
attr_accessor :test_count, :assertion_count
|
attr_accessor :test_count, :assertion_count
|
||||||
|
@ -321,16 +321,14 @@ module MiniTest
|
||||||
@@installed_at_exit ||= false
|
@@installed_at_exit ||= false
|
||||||
@@out = $stdout
|
@@out = $stdout
|
||||||
|
|
||||||
def self.disable_autorun
|
|
||||||
@@installed_at_exit = true
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.autorun
|
def self.autorun
|
||||||
at_exit {
|
at_exit {
|
||||||
|
p $!
|
||||||
|
return if $! # don't run if there was an exception
|
||||||
exit_code = MiniTest::Unit.new.run(ARGV)
|
exit_code = MiniTest::Unit.new.run(ARGV)
|
||||||
exit false if exit_code && exit_code != 0
|
exit false if exit_code && exit_code != 0
|
||||||
} unless @@installed_at_exit
|
} unless @@installed_at_exit
|
||||||
disable_autorun
|
@@installed_at_exit = true
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.output= stream
|
def self.output= stream
|
||||||
|
|
|
@ -69,9 +69,9 @@ class TestMiniTest < MiniTest::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_filter_backtrace_all_unit
|
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 +
|
BT_MIDDLE +
|
||||||
["./lib/mini/test.rb:29"])
|
["#{MINITEST_BASE_DIR}/test.rb:29"])
|
||||||
ex = bt.clone
|
ex = bt.clone
|
||||||
fu = MiniTest::filter_backtrace(bt)
|
fu = MiniTest::filter_backtrace(bt)
|
||||||
assert_equal ex, fu
|
assert_equal ex, fu
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue