From a4eedafb132deefd25fe8dc62b2305213b0bbed7 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 13 Sep 2017 17:07:19 +0000 Subject: 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 --- test/ruby/test_rubyoptions.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'test/ruby/test_rubyoptions.rb') diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index d6297c8979..5350041d07 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 -- cgit v1.2.1