diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-13 22:30:50 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-13 22:30:50 +0000 |
commit | 7909af18edf02a924c8a9ace9e657c9651a93c76 (patch) | |
tree | e15fd9de3e79c63567699752a517ce74b47f0703 /test/ruby/test_argf.rb | |
parent | 6ac9fea36f3d41862702ad232749560fe26a4c61 (diff) | |
download | ruby-7909af18edf02a924c8a9ace9e657c9651a93c76.tar.gz |
* io.c (argf_next_argv): go advance when the next file cannot be
read. [ruby-core:34446]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_argf.rb')
-rw-r--r-- | test/ruby/test_argf.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb index b8b40ec077..0e709a204d 100644 --- a/test/ruby/test_argf.rb +++ b/test/ruby/test_argf.rb @@ -720,6 +720,21 @@ class TestArgf < Test::Unit::TestCase ensure argf.close end + end + def test_unreadable + bug4274 = '[ruby-core:34446]' + paths = (1..2).map do + t = Tempfile.new("bug4274-") + path = t.path + t.close! + path + end + argf = ARGF.class.new(*paths) + paths.each do |path| + e = assert_raise(Errno::ENOENT) {argf.gets} + assert_match(/- #{Regexp.quote(path)}\z/, e.message) + end + assert_nil(argf.gets, bug4274) end end |