From 18f0a65018dd357a1815941618d3cf9f274e6239 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 17 Jul 2011 06:30:10 +0000 Subject: * error.c (rb_warn_m): accept multiple args in like puts. rdoc patch by Erik Price at [ruby-core:38119]. [Feature #5029] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 0325867496..c62edbba00 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1975,4 +1975,21 @@ End write_file.close file.close! end + + def test_warn + stderr = EnvUtil.verbose_warning do + warn "warning" + end + assert_equal("warning\n", stderr) + + stderr = EnvUtil.verbose_warning do + warn + end + assert_equal("", stderr) + + stderr = EnvUtil.verbose_warning do + warn "[Feature #5029]", "[ruby-core:38070]" + end + assert_equal("[Feature #5029]\n[ruby-core:38070]\n", stderr) + end end -- cgit v1.2.3