summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-13 17:07:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-13 17:07:19 +0000
commita4eedafb132deefd25fe8dc62b2305213b0bbed7 (patch)
treed8436707e99a170dd0938d9e7fd77981f02d1a0f
parente1ada191df831350219ffb465c3e8d0edabd8bb1 (diff)
test_rubyoptions.rb: keep paths if necessary
* test/ruby/test_rubyoptions.rb (TestRubyOptions#test_search): PATH must keep library loading paths on a platform where it is used for that purpose, for extra libraries. [ruby-core:81178] [Bug #13569] [Fix GH-1616] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_rubyoptions.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index d6297c8..5350041 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -298,13 +298,15 @@ class TestRubyOptions < Test::Unit::TestCase
@verbose = $VERBOSE
$VERBOSE = nil
- ENV['PATH'] = File.dirname(t.path)
+ path, name = *File.split(t.path)
- assert_in_out_err(%w(-S) + [File.basename(t.path)], "", %w(1), [])
-
- ENV['RUBYPATH'] = File.dirname(t.path)
+ ENV['PATH'] = (path_orig && RbConfig::CONFIG['LIBPATHENV'] == 'PATH') ?
+ [path, path_orig].join(File::PATH_SEPARATOR) : path
+ assert_in_out_err(%w(-S) + [name], "", %w(1), [])
+ ENV['PATH'] = path_orig
- assert_in_out_err(%w(-S) + [File.basename(t.path)], "", %w(1), [])
+ ENV['RUBYPATH'] = path
+ assert_in_out_err(%w(-S) + [name], "", %w(1), [])
}
ensure