Skip to content

Commit

Permalink
[rubygems/rubygems] Little refactor to keep things consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez authored and matzbot committed Sep 28, 2022
1 parent 874a2bf commit 00a040d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions test/rubygems/helper.rb
Expand Up @@ -1297,6 +1297,10 @@ def rubygems_path
$LOAD_PATH.find {|p| p == File.dirname($LOADED_FEATURES.find {|f| f.end_with?("/rubygems.rb") }) }
end

def bundler_path
$LOAD_PATH.find {|p| p == File.dirname($LOADED_FEATURES.find {|f| f.end_with?("/bundler.rb") }) }
end

def with_clean_path_to_ruby
orig_ruby = Gem.ruby

Expand Down
6 changes: 2 additions & 4 deletions test/rubygems/test_gem.rb
Expand Up @@ -1676,8 +1676,6 @@ def test_auto_activation_of_used_gemdeps_file
end
end

BUNDLER_LIB_PATH = File.expand_path $LOAD_PATH.find {|lp| File.file?(File.join(lp, "bundler.rb")) }

def add_bundler_full_name(names)
names << "bundler-#{Bundler::VERSION}".freeze
names.sort!
Expand Down Expand Up @@ -1708,7 +1706,7 @@ def test_looks_for_gemdeps_files_automatically_from_binstubs

with_rubygems_gemdeps("-") do
new_PATH = [File.join(path, "bin"), ENV["PATH"]].join(File::PATH_SEPARATOR)
new_RUBYOPT = "-I#{rubygems_path} -I#{BUNDLER_LIB_PATH}"
new_RUBYOPT = "-I#{rubygems_path} -I#{bundler_path}"

path = File.join @tempdir, "gem.deps.rb"

Expand Down Expand Up @@ -1759,7 +1757,7 @@ def test_looks_for_gemdeps_files_automatically_from_binstubs_in_parent_dir
Dir.mkdir "sub1"

new_PATH = [File.join(path, "bin"), ENV["PATH"]].join(File::PATH_SEPARATOR)
new_RUBYOPT = "-I#{rubygems_path} -I#{BUNDLER_LIB_PATH}"
new_RUBYOPT = "-I#{rubygems_path} -I#{bundler_path}"

path = File.join @tempdir, "gem.deps.rb"

Expand Down

0 comments on commit 00a040d

Please sign in to comment.