Skip to content

Commit

Permalink
[rubygems/rubygems] Remove unnecessary spec manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez authored and hsbt committed Aug 31, 2021
1 parent 199083d commit 19d77a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion lib/rubygems.rb
Expand Up @@ -1121,7 +1121,6 @@ def self.use_gemdeps(path = nil)
ensure
Gem::DefaultUserInteraction.ui.close
end
@gemdeps.requested_specs.map(&:to_spec).sort_by(&:name)
end

rescue => e
Expand Down
11 changes: 8 additions & 3 deletions test/rubygems/test_gem.rb
Expand Up @@ -674,7 +674,9 @@ def test_self_use_gemdeps
begin
Dir.chdir 'detect/a/b'

assert_equal add_bundler_full_name([]), Gem.use_gemdeps.map(&:full_name)
Gem.use_gemdeps

assert_equal add_bundler_full_name([]), loaded_spec_names
ensure
Dir.chdir @tempdir
end
Expand Down Expand Up @@ -1713,8 +1715,11 @@ def test_auto_activation_of_used_gemdeps_file

ENV['RUBYGEMS_GEMDEPS'] = "-"

expected_specs = [a, b, util_spec("bundler", Bundler::VERSION), c].compact
assert_equal expected_specs, Gem.use_gemdeps.sort_by {|s| s.name }
expected_specs = [a, b, util_spec("bundler", Bundler::VERSION), c].compact.map(&:full_name)

Gem.use_gemdeps

assert_equal expected_specs, loaded_spec_names
end

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

0 comments on commit 19d77a1

Please sign in to comment.