summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-12-19 22:36:15 +0100
committergit <svn-admin@ruby-lang.org>2021-12-21 06:48:27 +0900
commit01f95ede0e37cd6a1b7e3db3ed34131c24531210 (patch)
tree488b28a6136accfb581c19bdda507b3ee812c243
parenta350ed4123f138866940f7d9be950a2127c7f921 (diff)
[rubygems/rubygems] Rename `BUNDLE_SPEC_RUN` environment variable
The `BUNDLE_` prefix should be reserved to first class settings that should be listed when running `bundle config`. This one is just a hacky environment variable that has not corresponding documented setting. https://github.com/rubygems/rubygems/commit/7e255c5058
-rw-r--r--lib/bundler/shared_helpers.rb2
-rw-r--r--spec/bundler/commands/config_spec.rb16
-rw-r--r--spec/bundler/spec_helper.rb2
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 846b9cc3aa..e48010232a 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -239,7 +239,7 @@ module Bundler
current = File.expand_path(SharedHelpers.pwd).tap{|x| x.untaint if RUBY_VERSION < "2.7" }
until !File.directory?(current) || current == previous
- if ENV["BUNDLE_SPEC_RUN"]
+ if ENV["BUNDLER_SPEC_RUN"]
# avoid stepping above the tmp directory when testing
gemspec = if ENV["GEM_COMMAND"]
# for Ruby Core
diff --git a/spec/bundler/commands/config_spec.rb b/spec/bundler/commands/config_spec.rb
index 2d0a7dc989..9664fe6517 100644
--- a/spec/bundler/commands/config_spec.rb
+++ b/spec/bundler/commands/config_spec.rb
@@ -425,27 +425,27 @@ E
describe "subcommands" do
it "list" do
- bundle "config list"
- expect(out).to eq "Settings are listed in order of priority. The top value will be used.\nspec_run\nSet via BUNDLE_SPEC_RUN: \"true\""
+ bundle "config list", :env => { "BUNDLE_FOO" => "bar" }
+ expect(out).to eq "Settings are listed in order of priority. The top value will be used.\nfoo\nSet via BUNDLE_FOO: \"bar\""
- bundle "config list", :parseable => true
- expect(out).to eq "spec_run=true"
+ bundle "config list", :env => { "BUNDLE_FOO" => "bar" }, :parseable => true
+ expect(out).to eq "foo=bar"
end
it "list with credentials" do
bundle "config list", :env => { "BUNDLE_GEMS__MYSERVER__COM" => "user:password" }
- expect(out).to eq "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"user:[REDACTED]\"\n\nspec_run\nSet via BUNDLE_SPEC_RUN: \"true\""
+ expect(out).to eq "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"user:[REDACTED]\""
bundle "config list", :parseable => true, :env => { "BUNDLE_GEMS__MYSERVER__COM" => "user:password" }
- expect(out).to eq "gems.myserver.com=user:password\nspec_run=true"
+ expect(out).to eq "gems.myserver.com=user:password"
end
it "list with API token credentials" do
bundle "config list", :env => { "BUNDLE_GEMS__MYSERVER__COM" => "api_token:x-oauth-basic" }
- expect(out).to eq "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"[REDACTED]:x-oauth-basic\"\n\nspec_run\nSet via BUNDLE_SPEC_RUN: \"true\""
+ expect(out).to eq "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"[REDACTED]:x-oauth-basic\""
bundle "config list", :parseable => true, :env => { "BUNDLE_GEMS__MYSERVER__COM" => "api_token:x-oauth-basic" }
- expect(out).to eq "gems.myserver.com=api_token:x-oauth-basic\nspec_run=true"
+ expect(out).to eq "gems.myserver.com=api_token:x-oauth-basic"
end
it "get" do
diff --git a/spec/bundler/spec_helper.rb b/spec/bundler/spec_helper.rb
index 4d558b9907..96b2f16c82 100644
--- a/spec/bundler/spec_helper.rb
+++ b/spec/bundler/spec_helper.rb
@@ -71,7 +71,7 @@ RSpec.configure do |config|
require_relative "support/rubygems_ext"
Spec::Rubygems.test_setup
- ENV["BUNDLE_SPEC_RUN"] = "true"
+ ENV["BUNDLER_SPEC_RUN"] = "true"
ENV["BUNDLE_USER_CONFIG"] = ENV["BUNDLE_USER_CACHE"] = ENV["BUNDLE_USER_PLUGIN"] = nil
ENV["RUBYGEMS_GEMDEPS"] = nil
ENV["XDG_CONFIG_HOME"] = nil