diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/envutil.rb | 2 | ||||
| -rw-r--r-- | test/ruby/test_rubyoptions.rb | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index 4aba8a0bde..04ab09e03c 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -115,7 +115,7 @@ module Test end LANG_ENVS = %w"LANG LC_ALL LC_CTYPE" - def assert_in_out_err(args, test_stdin = "", test_stdout = "", test_stderr = "", message = nil) + def assert_in_out_err(args, test_stdin = "", test_stdout = [], test_stderr = [], message = nil) in_c, in_p = IO.pipe out_p, out_c = IO.pipe err_p, err_c = IO.pipe diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 6db7ff32c4..b8bdb9b5cb 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -295,4 +295,13 @@ class TestRubyOptions < Test::Unit::TestCase ensure t.close(true) if t end + + def test_notfound + notexist = "./notexist.rb" + rubybin = Regexp.quote(EnvUtil.rubybin) + pat = /\A#{rubybin}:.* -- #{Regexp.quote(notexist)} \(LoadError\)\Z/ + assert_equal(false, File.exist?(notexist)) + assert_in_out_err(["-r", notexist, "-ep"], "", [], pat) + assert_in_out_err([notexist], "", [], pat) + end end |
