diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-27 14:24:11 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-27 14:24:11 +0000 |
commit | fb7988402f872b516a1b9974254fb04d2f9deee5 (patch) | |
tree | f8a416533588e4c0c9fb9374136dd35e3cd6b69d | |
parent | 03b3446556d23303ce0016d3c5cf1b0d1714c6ef (diff) |
merges a half of revision 5875 in MiniTest's repository into ruby_1_9_2. It corresponds to
r29259 on Ruby's trunk.
--
assert_raises now lets MiniTest::Skip through. (shyouhei)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/minitest/unit.rb | 9 | ||||
-rw-r--r-- | test/minitest/test_mini_test.rb | 20 | ||||
-rw-r--r-- | version.h | 6 |
3 files changed, 32 insertions, 3 deletions
diff --git a/lib/minitest/unit.rb b/lib/minitest/unit.rb index 3e038c818f..aa5890eb4a 100644 --- a/lib/minitest/unit.rb +++ b/lib/minitest/unit.rb @@ -204,6 +204,14 @@ module MiniTest begin yield should_raise = true + rescue MiniTest::Skip => e + details = "#{msg}#{mu_pp(exp)} exception expected, not" + + if exp.include? MiniTest::Skip then + return e + else + raise e + end rescue Exception => e details = "#{msg}#{mu_pp(exp)} exception expected, not" assert(exp.any? { |ex| @@ -243,6 +251,7 @@ module MiniTest # +send_ary+ is a receiver, message and arguments. # # Fails unless the call returns a true value + # TODO: I should prolly remove this from specs def assert_send send_ary, m = nil recv, msg, *args = send_ary diff --git a/test/minitest/test_mini_test.rb b/test/minitest/test_mini_test.rb index 7ceb4f3c06..c29d9b6e52 100644 --- a/test/minitest/test_mini_test.rb +++ b/test/minitest/test_mini_test.rb @@ -609,6 +609,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 @@ -1,13 +1,13 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 160 +#define RUBY_PATCHLEVEL 161 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 #define RUBY_RELEASE_YEAR 2011 #define RUBY_RELEASE_MONTH 1 -#define RUBY_RELEASE_DAY 16 -#define RUBY_RELEASE_DATE "2011-01-16" +#define RUBY_RELEASE_DAY 27 +#define RUBY_RELEASE_DATE "2011-01-27" #include "ruby/version.h" |