diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-30 12:51:59 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-30 12:51:59 +0000 |
commit | e2a553e4734b17be9378b8120ad3bb7f818789c5 (patch) | |
tree | de9c37e6aecec290d63666964cc5da9848e4c738 /test | |
parent | 495670d273617cc0874ca53d748bff5f3849d1e4 (diff) |
merges r25435 from trunk into ruby_1_9_1.
--
* test/ruby/envutil.rb (assert_in_out_err): test_stdout and
test_stderr should be an array.
* test/ruby/test_rubyoptions.rb (test_notfound): test_stdin of
assert_in_out_err should be a string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 |