From 8903faf1a1e8cec44b3587a3cd88bf25cfe10515 Mon Sep 17 00:00:00 2001 From: yugui Date: Wed, 17 Nov 2010 07:08:07 +0000 Subject: [PATCH] * test/ruby/envutil.rb (Test::Unit::Assersions#assert_warn): new assersion to assert that a particular warning message is displayed. forwardport from branches/ruby_1_9_2@29795. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ test/ruby/envutil.rb | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 18567e3610..9c577fb1e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Nov 17 16:04:23 2010 Yuki Sonoda (Yugui) + + * test/ruby/envutil.rb (Test::Unit::Assersions#assert_warn): + new assersion to assert that a particular warning message is + displayed. + forwardport from branches/ruby_1_9_2@29795. + Wed Nov 17 15:16:48 2010 NARUSE, Yui * regint.h (OnigOpInfoType): constify name. diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index 8d7a1eef24..7b235106cb 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -173,6 +173,11 @@ module Test assert(status.success?, m) end + def assert_warn(msg) + stderr = EnvUtil.verbose_warning { yield } + assert(msg === stderr, "warning message #{stderr.inspect} is expected to match #{msg.inspect}") + end + end end end