mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Imported minitest 1.4.0 r5083.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7fc9c4a4a0
commit
58cfb41d2a
5 changed files with 49 additions and 24 deletions
|
|
@ -325,7 +325,8 @@ Finished in 0.00
|
|||
output.sub!(/^(\s+)(?:#{Regexp.union(__FILE__, File.expand_path(__FILE__))}):\d+:/o, '\1FILE:LINE:')
|
||||
output.sub!(/\[(?:#{Regexp.union(__FILE__, File.expand_path(__FILE__))}):\d+\]/o, '[FILE:LINE]')
|
||||
assert_equal(expected, output)
|
||||
end
|
||||
end
|
||||
|
||||
def test_run_failing_filtered
|
||||
tc = Class.new(MiniTest::Unit::TestCase) do
|
||||
def test_something
|
||||
|
|
@ -468,10 +469,9 @@ class TestMiniTestTestCase < MiniTest::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_assert_in_delta_triggered
|
||||
e = assert_raises(MiniTest::Assertion) do
|
||||
util_assert_triggered 'Expected 0.0 - 0.001 (0.001) to be < 1.0e-06.' do
|
||||
@tc.assert_in_delta 0.0, 1.0 / 1000, 0.000001
|
||||
end
|
||||
assert_match /\AExpected 0\.0 - 0\.001 \(0\.001\) to be < (?:1\.0+\de-06|9\.9+\de-07).\z/, e.message
|
||||
end
|
||||
|
||||
def test_assert_in_epsilon
|
||||
|
|
@ -489,10 +489,9 @@ class TestMiniTestTestCase < MiniTest::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_assert_in_epsilon_triggered
|
||||
e = assert_raises(MiniTest::Assertion) do
|
||||
util_assert_triggered 'Expected 10000 - 9990 (10) to be < 9.99.' do
|
||||
@tc.assert_in_epsilon 10000, 9990
|
||||
end
|
||||
assert_match(/\AExpected 10000 - 9990 \(10\) to be < 9\.99*\d*\.\z/, e.message)
|
||||
end
|
||||
end
|
||||
|
||||
def test_assert_includes
|
||||
|
|
@ -831,10 +830,9 @@ FILE:LINE:in `test_assert_raises_triggered_subclass'
|
|||
end
|
||||
|
||||
def test_refute_in_delta_triggered
|
||||
e = assert_raises(MiniTest::Assertion) do
|
||||
util_assert_triggered 'Expected 0.0 - 0.001 (0.001) to not be < 0.1.' do
|
||||
@tc.refute_in_delta 0.0, 1.0 / 1000, 0.1
|
||||
end
|
||||
assert_match /\AExpected 0\.0 - 0\.001 \(0\.001\) to not be < 0\.10*\d*\.\z/, e.message
|
||||
end
|
||||
|
||||
def test_refute_in_epsilon
|
||||
|
|
@ -983,11 +981,6 @@ FILE:LINE:in `test_assert_raises_triggered_subclass'
|
|||
msg = e.message.sub(/(---Backtrace---).*/m, '\1')
|
||||
msg.gsub!(/\(0x[0-9a-f]+\)/, '(0xXXX)')
|
||||
|
||||
begin
|
||||
assert_equal expected, msg
|
||||
rescue MiniTest::Assertion => e
|
||||
e.backtrace.shift(3)
|
||||
raise
|
||||
end
|
||||
assert_equal expected, msg
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue