diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_io.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 00369365d0..89c68b6cb2 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2184,6 +2184,15 @@ class TestIO < Test::Unit::TestCase end end + def test_read_command + assert_warn(/invoke external command/) do + File.read("|#{EnvUtil.rubybin} -e puts") + end + assert_raise_with_message(ArgumentError, /invoke external command/) do + Class.new(IO).read("|#{EnvUtil.rubybin} -e puts") + end + end + def test_reopen make_tempfile {|t| open(__FILE__) do |f| |