From cfecd21a89708cdddac56effafd3de804785a3ea Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 7 Sep 2015 15:14:46 +0000 Subject: process.c: open exception message * process.c (rb_execarg_parent_start1): raise with the target path name when open() failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/ruby/test_process.rb') diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index cd649053c0..6828c50bf1 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -424,6 +424,24 @@ class TestProcess < Test::Unit::TestCase } end + def test_execopts_open_failure + with_tmpchdir {|d| + assert_raise_with_message(Errno::ENOENT, %r"d/notexist") { + Process.wait Process.spawn(*PWD, :in => "d/notexist") + } + assert_raise_with_message(Errno::ENOENT, %r"d/notexist") { + Process.wait Process.spawn(*PWD, :out => "d/notexist") + } + n = "d/\u{1F37A}" + assert_raise_with_message(Errno::ENOENT, /#{n}/) { + Process.wait Process.spawn(*PWD, :in => n) + } + assert_raise_with_message(Errno::ENOENT, /#{n}/) { + Process.wait Process.spawn(*PWD, :out => n) + } + } + end + UMASK = [RUBY, '-e', 'printf "%04o\n", File.umask'] def test_execopts_umask -- cgit v1.2.3