summaryrefslogtreecommitdiff
path: root/test/minitest
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-23 21:27:19 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-23 21:27:19 +0000
commit4c6551b7d36d8741ec5418de073a10d5c01e7246 (patch)
treea6ce3a02d90e3ce6a075074b13f4dcb2aa067848 /test/minitest
parentd1a4b542186800607a60490d3aef8e244e00ca0c (diff)
downloadruby-4c6551b7d36d8741ec5418de073a10d5c01e7246.tar.gz
Imported minitest 1.7.2 r5879.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/minitest')
-rw-r--r--test/minitest/test_mini_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/minitest/test_mini_test.rb b/test/minitest/test_mini_test.rb
index 1cbc829a7f..176f6ec26f 100644
--- a/test/minitest/test_mini_test.rb
+++ b/test/minitest/test_mini_test.rb
@@ -642,6 +642,26 @@ class TestMiniTestTestCase < MiniTest::Unit::TestCase
end
end
+ ##
+ # *sigh* This is quite an odd scenario, but it is from real (albeit
+ # ugly) test code in ruby-core:
+ #
+ # http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29259
+
+ def test_assert_raises_skip
+ @assertion_count = 0
+
+ util_assert_triggered "skipped", MiniTest::Skip do
+ @tc.assert_raises ArgumentError do
+ begin
+ raise "blah"
+ rescue
+ skip "skipped"
+ end
+ end
+ end
+ end
+
def test_assert_raises_module
@tc.assert_raises M do
raise E
@@ -828,6 +848,8 @@ FILE:LINE:in `test_assert_raises_triggered_subclass'
def test_capture_io
@assertion_count = 0
+ orig_verbose = $VERBOSE
+ $VERBOSE = false
out, err = capture_io do
puts 'hi'
warn 'bye!'
@@ -835,6 +857,8 @@ FILE:LINE:in `test_assert_raises_triggered_subclass'
assert_equal "hi\n", out
assert_equal "bye!\n", err
+ ensure
+ $VERBOSE = orig_verbose
end
def test_class_asserts_match_refutes