diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-17 07:08:07 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-17 07:08:07 +0000 |
commit | 8903faf1a1e8cec44b3587a3cd88bf25cfe10515 (patch) | |
tree | 0de36ba4a1d82564ad3f926d7f07db3fe760a3a5 /test/ruby | |
parent | 8e2a1cba362cf4a464b6233f23f485f7b91696c3 (diff) | |
download | ruby-8903faf1a1e8cec44b3587a3cd88bf25cfe10515.tar.gz |
* 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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/envutil.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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 |