aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-27 06:47:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-27 06:47:56 +0000
commit7a5b56677a075677439fbfc61025ddf93ca708f8 (patch)
treed9897bde3b61eed064dbf177e425adcfe0b9883c /test
parentd226ce8decef356c7447efb6b6b325bc8fc53dba (diff)
downloadruby-7a5b56677a075677439fbfc61025ddf93ca708f8.tar.gz
stringio.c: warn block for new
* ext/stringio/stringio.c (strio_s_new): warn if a block is given, as well as IO.new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/stringio/test_stringio.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb
index e443fa6c26..bf3a9eeb1b 100644
--- a/test/stringio/test_stringio.rb
+++ b/test/stringio/test_stringio.rb
@@ -674,4 +674,10 @@ class TestStringIO < Test::Unit::TestCase
bug_11945 = '[ruby-core:72699] [Bug #11945]'
assert_equal Encoding::ASCII_8BIT, s.external_encoding, bug_11945
end
+
+ def test_new_block_warning
+ assert_warn(/does not take block/) do
+ StringIO.new {}
+ end
+ end
end