From 9c8fc97c0a8f4ad77b868aeda9376f9cdaaa09e4 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 22 Oct 2015 04:13:52 +0000 Subject: io.c: check ARGV element type * io.c (argf_next_argv): check ARGV element type, and try conversion if necessary. [ruby-core:71140] [Bug #11610] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_argf.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb index a9ba9f64e2..cb27b9c64e 100644 --- a/test/ruby/test_argf.rb +++ b/test/ruby/test_argf.rb @@ -899,4 +899,12 @@ class TestArgf < Test::Unit::TestCase assert_equal "done with eof\n", f.gets end end + + def test_wrong_type + assert_separately([], <<-'end;') + bug11610 = '[ruby-core:71140] [Bug #11610]' + ARGV[0] = nil + assert_raise(TypeError, bug11610) {gets} + end; + end end -- cgit v1.2.3