Skip to content

Commit

Permalink
Check not having load system features also for successful runs
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Nov 23, 2021
1 parent dc391f4 commit 4807bd1
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions bundler/spec/support/rubygems_version_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ def switch

def assert_system_features_not_loaded!
at_exit do
errors = if $!.nil?
""
else
all_commands_output
end

rubylibdir = RbConfig::CONFIG["rubylibdir"]

rubygems_path = rubylibdir + "/rubygems"
Expand All @@ -43,11 +37,11 @@ def assert_system_features_not_loaded!
(loaded_feature.start_with?(bundler_path) && !bundler_exemptions.any? {|bundler_exemption| loaded_feature.start_with?(bundler_exemption) })
end

if bad_loaded_features.any?
errors += "the following features were incorrectly loaded:\n#{bad_loaded_features.join("\n")}"
errors = if bad_loaded_features.any?
all_commands_output + "the following features were incorrectly loaded:\n#{bad_loaded_features.join("\n")}"
end

raise errors unless errors.empty?
raise errors if errors
end
end

Expand Down

0 comments on commit 4807bd1

Please sign in to comment.