Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Undo the last change in lib
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Aug 7, 2019
1 parent 65930b0 commit dbd8141
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/bundler.rb
Expand Up @@ -299,7 +299,7 @@ def unbundled_env
env.delete_if {|k, _| k[0, 7] == "BUNDLE_" }

if env.key?("RUBYOPT")
env["RUBYOPT"] = env["RUBYOPT"].sub "-r#{File.expand_path("bundler/setup", __dir__)}", ""
env["RUBYOPT"] = env["RUBYOPT"].sub "-rbundler/setup", ""
end

if env.key?("RUBYLIB")
Expand Down
16 changes: 8 additions & 8 deletions spec/runtime/with_unbundled_env_spec.rb
@@ -1,15 +1,15 @@
# frozen_string_literal: true

RSpec.describe "Bundler.with_env helpers" do
def bundle_exec_ruby!(code)
build_bundler_context
bundle! "exec '#{Gem.ruby}' -e #{code}"
def bundle_exec_ruby!(code, options = {})
build_bundler_context options
bundle! "exec '#{Gem.ruby}' -e #{code}", options
end

def build_bundler_context
def build_bundler_context(options = {})
bundle "config set path vendor/bundle"
gemfile ""
bundle "install"
bundle "install", options
end

describe "Bundler.original_env" do
Expand Down Expand Up @@ -74,9 +74,9 @@ def build_bundler_context

it "should remove '-rbundler/setup' from RUBYOPT" do
code = "print #{modified_env}['RUBYOPT']"
ENV["RUBYOPT"] = "-W2 -r#{lib}/bundler/setup #{ENV["RUBYOPT"]}"
bundle_exec_ruby! code.dump
expect(last_command.stdboth).not_to include("-r#{lib}/bundler/setup")
ENV["RUBYOPT"] = "-W2 -rbundler/setup #{ENV["RUBYOPT"]}"
bundle_exec_ruby! code.dump, :env => { "BUNDLER_SPEC_DISABLE_DEFAULT_BUNDLER_GEM" => "true" }
expect(last_command.stdboth).not_to include("-rbundler/setup")
end

it "should restore RUBYLIB", :ruby_repo do
Expand Down
2 changes: 1 addition & 1 deletion spec/support/hax.rb
Expand Up @@ -14,7 +14,7 @@ class Platform
@platforms = [Gem::Platform::RUBY, Gem::Platform.local]

# We only need this hack for rubygems versions without the BundlerVersionFinder
if Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
if Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0") || ENV["BUNDLER_SPEC_DISABLE_DEFAULT_BUNDLER_GEM"]
@path_to_default_spec_map.delete_if do |_path, spec|
spec.name == "bundler"
end
Expand Down

0 comments on commit dbd8141

Please sign in to comment.