ruby-changes:33681
From: usa <ko1@a...>
Date: Wed, 30 Apr 2014 23:53:24 +0900 (JST)
Subject: [ruby-changes:33681] usa:r45762 (ruby_2_0_0): missed at r45748.
usa 2014-04-30 23:53:19 +0900 (Wed, 30 Apr 2014) New Revision: 45762 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45762 Log: missed at r45748. Modified files: branches/ruby_2_0_0/test/ruby/envutil.rb branches/ruby_2_0_0/version.h Index: ruby_2_0_0/version.h =================================================================== --- ruby_2_0_0/version.h (revision 45761) +++ ruby_2_0_0/version.h (revision 45762) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1 #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2014-04-30" -#define RUBY_PATCHLEVEL 476 +#define RUBY_PATCHLEVEL 477 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 4 Index: ruby_2_0_0/test/ruby/envutil.rb =================================================================== --- ruby_2_0_0/test/ruby/envutil.rb (revision 45761) +++ ruby_2_0_0/test/ruby/envutil.rb (revision 45762) @@ -375,6 +375,29 @@ eom https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/envutil.rb#L375 assert(1.0/f == -Float::INFINITY, "#{f} is not -0.0") end + def assert_raise_with_message(exception, expected, msg = nil, &block) + case expected + when String + assert = :assert_equal + when Regexp + assert = :assert_match + else + raise TypeError, "Expected #{expected.inspect} to be a kind of String or Regexp, not #{expected.class}" + end + + ex = assert_raise(exception, *msg) {yield} + msg = message(msg, "") {"Expected Exception(#{exception}) was raised, but the message doesn't match"} + + if assert == :assert_equal + assert_equal(expected, ex.message, msg) + else + msg = message(msg) { "Expected #{mu_pp expected} to match #{mu_pp ex.message}" } + assert expected =~ ex.message, msg + block.binding.eval("proc{|_|$~=_}").call($~) + end + ex + end + def assert_file AssertFile end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/