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
This commit is contained in:
nobu 2017-09-13 17:07:19 +00:00
Родитель e1ada191df
Коммит a4eedafb13
1 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -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['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
ENV['RUBYPATH'] = File.dirname(t.path)
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