summaryrefslogtreecommitdiff
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r--test/ruby/test_io.rb17
1 files changed, 17 insertions, 0 deletions
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