summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-07 15:14:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-07 15:14:46 +0000
commitcfecd21a89708cdddac56effafd3de804785a3ea (patch)
tree8c866536be682808f07d56745bd2c355bc42d0c7 /test
parentbe3de529c24ae4d12c030f915d4d4914e2d5ceb5 (diff)
downloadruby-cfecd21a89708cdddac56effafd3de804785a3ea.tar.gz
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_process.rb18
1 files changed, 18 insertions, 0 deletions
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