diff options
| author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2026-03-26 20:47:00 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-03-27 00:46:04 +0000 |
| commit | bacf17308ebffc87dcdeecb4f547742c1842291d (patch) | |
| tree | 6b987a2a2ad32c76671169f24d5ee14235b0a598 /spec/bundler/commands | |
| parent | c6fb7382ca239fe92a497d738f78017ecac208a7 (diff) | |
[ruby/rubygems] Replace `bundle "config set KEY VALUE"` subprocess with in-process config helper
https://github.com/ruby/rubygems/commit/85260feefd
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'spec/bundler/commands')
| -rw-r--r-- | spec/bundler/commands/add_spec.rb | 2 | ||||
| -rw-r--r-- | spec/bundler/commands/binstubs_spec.rb | 8 | ||||
| -rw-r--r-- | spec/bundler/commands/cache_spec.rb | 14 | ||||
| -rw-r--r-- | spec/bundler/commands/check_spec.rb | 6 | ||||
| -rw-r--r-- | spec/bundler/commands/clean_spec.rb | 86 | ||||
| -rw-r--r-- | spec/bundler/commands/console_spec.rb | 6 | ||||
| -rw-r--r-- | spec/bundler/commands/exec_spec.rb | 16 | ||||
| -rw-r--r-- | spec/bundler/commands/fund_spec.rb | 2 | ||||
| -rw-r--r-- | spec/bundler/commands/info_spec.rb | 2 | ||||
| -rw-r--r-- | spec/bundler/commands/install_spec.rb | 12 | ||||
| -rw-r--r-- | spec/bundler/commands/licenses_spec.rb | 2 | ||||
| -rw-r--r-- | spec/bundler/commands/lock_spec.rb | 10 | ||||
| -rw-r--r-- | spec/bundler/commands/newgem_spec.rb | 38 | ||||
| -rw-r--r-- | spec/bundler/commands/open_spec.rb | 2 | ||||
| -rw-r--r-- | spec/bundler/commands/outdated_spec.rb | 8 | ||||
| -rw-r--r-- | spec/bundler/commands/post_bundle_message_spec.rb | 2 | ||||
| -rw-r--r-- | spec/bundler/commands/show_spec.rb | 2 | ||||
| -rw-r--r-- | spec/bundler/commands/update_spec.rb | 4 | ||||
| -rw-r--r-- | spec/bundler/commands/version_spec.rb | 8 |
19 files changed, 115 insertions, 115 deletions
diff --git a/spec/bundler/commands/add_spec.rb b/spec/bundler/commands/add_spec.rb index ed98a914f3..5c6b3d770a 100644 --- a/spec/bundler/commands/add_spec.rb +++ b/spec/bundler/commands/add_spec.rb @@ -291,7 +291,7 @@ RSpec.describe "bundle add" do end it "shows error message when gem cannot be found" do - bundle "config set force_ruby_platform true" + config "force_ruby_platform true" bundle "add 'werk_it'", raise_on_error: false expect(err).to match("Could not find gem 'werk_it' in") diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb index 4cc3ba24b3..e618f02a25 100644 --- a/spec/bundler/commands/binstubs_spec.rb +++ b/spec/bundler/commands/binstubs_spec.rb @@ -158,7 +158,7 @@ RSpec.describe "bundle binstubs <gem>" do context "with the binstubs dir configured" do before do - bundle "config set bin exec" + config "bin exec" end it "creates the binstubs in the configured dir" do @@ -193,7 +193,7 @@ RSpec.describe "bundle binstubs <gem>" do end it "generates a standalone binstub at the given path when configured" do - bundle "config set bin foo" + config "bin foo" bundle "binstubs myrack --standalone" expect(bundled_app("foo/myrackup")).to exist end @@ -313,7 +313,7 @@ RSpec.describe "bundle binstubs <gem>" do gem "myrack" G - bundle "config set auto_install 1" + config "auto_install 1" bundle "binstubs myrack" expect(out).to include("Installing myrack 1.0.0") expect(the_bundle).to include_gems "myrack 1.0.0" @@ -325,7 +325,7 @@ RSpec.describe "bundle binstubs <gem>" do gem "myrack" G - bundle "config set auto_install 1" + config "auto_install 1" bundle "binstubs myrack", env: { "BUNDLE_INSTALL" => "1" } expect(out).not_to include("Installing myrack 1.0.0") end diff --git a/spec/bundler/commands/cache_spec.rb b/spec/bundler/commands/cache_spec.rb index 3a83f34ef8..a3225b3d93 100644 --- a/spec/bundler/commands/cache_spec.rb +++ b/spec/bundler/commands/cache_spec.rb @@ -37,7 +37,7 @@ RSpec.describe "bundle cache" do gem 'bundler' D - bundle "config set cache_all true" + config "cache_all true" bundle :cache expect(bundled_app("vendor/cache/myrack-1.0.0.gem")).to exist @@ -68,7 +68,7 @@ RSpec.describe "bundle cache" do gemspec D - bundle "config set cache_all true" + config "cache_all true" bundle :cache expect(bundled_app("vendor/cache/myrack-1.0.0.gem")).to exist @@ -100,7 +100,7 @@ RSpec.describe "bundle cache" do gemspec D - bundle "config set cache_all true" + config "cache_all true" bundle :cache expect(bundled_app("vendor/cache/myrack-1.0.0.gem")).to exist @@ -145,7 +145,7 @@ RSpec.describe "bundle cache" do gemspec :name => 'mygem_test' D - bundle "config set cache_all true" + config "cache_all true" bundle :cache expect(bundled_app("vendor/cache/myrack-1.0.0.gem")).to exist @@ -506,8 +506,8 @@ RSpec.describe "bundle install with gem sources" do L simulate_platform "x86_64-linux" do - bundle "config set cache_all_platforms true" - bundle "config set path vendor/bundle" + config "cache_all_platforms true" + config "path vendor/bundle" bundle :cache, artifice: "compact_index", env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s } # simulate removal of all remote gems @@ -572,7 +572,7 @@ RSpec.describe "bundle install with gem sources" do FileUtils.cp gem_repo4("gems/bcrypt_pbkdf-1.1.1-arm64-darwin.gem"), app_cache FileUtils.cp gem_repo4("gems/bcrypt_pbkdf-1.1.1.gem"), app_cache - bundle "config set cache_all_platforms true" + config "cache_all_platforms true" lockfile <<~L GEM diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index 4bda7fd850..570e5144d8 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -88,7 +88,7 @@ RSpec.describe "bundle check" do it "prints a generic error if gem git source is not checked out" do build_git "foo", path: lib_path("foo") - bundle "config set path vendor/bundle" + config "path vendor/bundle" install_gemfile <<-G source "https://gem.repo1" @@ -124,7 +124,7 @@ RSpec.describe "bundle check" do end it "uses the without setting" do - bundle "config set without foo" + config "without foo" install_gemfile <<-G source "https://gem.repo1" group :foo do @@ -499,7 +499,7 @@ RSpec.describe "bundle check" do build_gem "bar" end - bundle "config set path.system true" + config "path.system true" # Add all gems to ensure all gems are installed so that a bundle check # would be successful diff --git a/spec/bundler/commands/clean_spec.rb b/spec/bundler/commands/clean_spec.rb index 582bfd5fd1..23f64dbb7c 100644 --- a/spec/bundler/commands/clean_spec.rb +++ b/spec/bundler/commands/clean_spec.rb @@ -25,8 +25,8 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "config set path vendor/bundle" - bundle "config set clean false" + config "path vendor/bundle" + config "clean false" bundle "install" gemfile <<-G @@ -54,8 +54,8 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "config set path vendor/bundle" - bundle "config set clean false" + config "path vendor/bundle" + config "clean false" bundle "install" gemfile <<-G @@ -84,8 +84,8 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "config set path vendor/bundle" - bundle "config set clean false" + config "path vendor/bundle" + config "clean false" bundle "install" gemfile <<-G @@ -117,9 +117,9 @@ RSpec.describe "bundle clean" do end G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" - bundle "config set without test_group" + config "without test_group" bundle "install" bundle :clean @@ -145,7 +145,7 @@ RSpec.describe "bundle clean" do end G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" bundle :clean @@ -169,7 +169,7 @@ RSpec.describe "bundle clean" do end G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" gemfile <<-G @@ -233,7 +233,7 @@ RSpec.describe "bundle clean" do end G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" update_git "foo-bar", path: lib_path("foo-bar") @@ -265,7 +265,7 @@ RSpec.describe "bundle clean" do gem "activesupport", :git => "#{lib_path("rails")}", :ref => '#{revision}' G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" bundle :clean expect(out).to include("") @@ -288,8 +288,8 @@ RSpec.describe "bundle clean" do end end G - bundle "config set path vendor/bundle" - bundle "config set without test" + config "path vendor/bundle" + config "without test" bundle "install" bundle :clean @@ -311,15 +311,15 @@ RSpec.describe "bundle clean" do end G - bundle "config set path vendor/bundle" - bundle "config set without development" + config "path vendor/bundle" + config "without development" bundle "install" bundle :clean end it "displays an error when used without --path" do - bundle "config set path.system true" + config "path.system true" install_gemfile <<-G source "https://gem.repo1" @@ -341,7 +341,7 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" gemfile <<-G @@ -364,7 +364,7 @@ RSpec.describe "bundle clean" do end it "does not call clean automatically when using system gems" do - bundle "config set path.system true" + config "path.system true" install_gemfile <<-G source "https://gem.repo1" @@ -449,7 +449,7 @@ RSpec.describe "bundle clean" do gem "thin" gem "myrack" G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" gemfile <<-G @@ -470,7 +470,7 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" update_repo2 do @@ -482,7 +482,7 @@ RSpec.describe "bundle clean" do end it "does not clean on bundle update when installing to system gems" do - bundle "config set path.system true" + config "path.system true" build_repo2 @@ -503,7 +503,7 @@ RSpec.describe "bundle clean" do end it "cleans system gems when --force is used" do - bundle "config set path.system true" + config "path.system true" gemfile <<-G source "https://gem.repo1" @@ -572,7 +572,7 @@ RSpec.describe "bundle clean" do gem "foo", :git => "#{lib_path("foo-1.0")}" G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" # mimic 7 length git revisions in Gemfile.lock @@ -582,7 +582,7 @@ RSpec.describe "bundle clean" do end lockfile(bundled_app_lock, gemfile_lock.join("\n")) - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" bundle :clean @@ -593,7 +593,7 @@ RSpec.describe "bundle clean" do end it "when using --force on system gems, it doesn't remove binaries" do - bundle "config set path.system true" + config "path.system true" build_repo2 do build_gem "bindir" do |s| @@ -649,7 +649,7 @@ RSpec.describe "bundle clean" do gem "bar", "1.0", :path => "#{relative_path}" G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" bundle :clean end @@ -662,8 +662,8 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "config set path vendor/bundle" - bundle "config set clean false" + config "path vendor/bundle" + config "clean false" bundle "install" gemfile <<-G @@ -692,8 +692,8 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "config set path vendor/bundle" - bundle "config set clean false" + config "path vendor/bundle" + config "clean false" bundle "install" gemfile <<-G @@ -722,10 +722,10 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "config set path vendor/bundle" - bundle "config set clean false" + config "path vendor/bundle" + config "clean false" bundle "install" - bundle "config set dry_run false" + config "dry_run false" gemfile <<-G source "https://gem.repo1" @@ -754,8 +754,8 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle "config set path vendor/bundle" - bundle "config set clean false" + config "path vendor/bundle" + config "clean false" bundle "install" gemfile <<-G @@ -765,7 +765,7 @@ RSpec.describe "bundle clean" do gem "weakling" G - bundle "config set auto_install 1" + config "auto_install 1" bundle :clean expect(out).to include("Installing weakling 0.0.3") should_have_gems "thin-1.0", "myrack-1.0.0", "weakling-0.0.3" @@ -783,7 +783,7 @@ RSpec.describe "bundle clean" do gem "very_simple_git_binary", :git => "#{lib_path("very_simple_git_binary-1.0")}", :ref => "#{revision}" G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" expect(vendored_gems("bundler/gems/extensions")).to exist expect(vendored_gems("bundler/gems/very_simple_git_binary-1.0-#{revision[0..11]}")).to exist @@ -804,7 +804,7 @@ RSpec.describe "bundle clean" do gem "simple_binary" G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" very_simple_binary_extensions_dir = @@ -844,7 +844,7 @@ RSpec.describe "bundle clean" do gem "very_simple_git_binary", :git => "#{lib_path("very_simple_git_binary-1.0")}", :ref => "#{revision}" G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" very_simple_binary_extensions_dir = @@ -888,8 +888,8 @@ RSpec.describe "bundle clean" do G bundle :lock - bundle "config set without development" - bundle "config set path vendor/bundle" + config "without development" + config "path vendor/bundle" bundle "install", verbose: true bundle :clean @@ -906,7 +906,7 @@ RSpec.describe "bundle clean" do gem "myrack" G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle "install" version = Bundler.gem_version.to_s diff --git a/spec/bundler/commands/console_spec.rb b/spec/bundler/commands/console_spec.rb index ec44fe59f3..1a2ccbfd8d 100644 --- a/spec/bundler/commands/console_spec.rb +++ b/spec/bundler/commands/console_spec.rb @@ -124,7 +124,7 @@ RSpec.describe "bundle console", readline: true do gem "irb" gem "pry" G - bundle "config set console pry" + config "console pry" bundle "console" do |input, _, _| input.puts("__method__") @@ -136,7 +136,7 @@ RSpec.describe "bundle console", readline: true do it "falls back to IRB if the other REPL isn't available" do skip "Does not work in a ruby-core context if irb is in the default $LOAD_PATH because it enables the real IRB, not our dummy one" if ruby_core? && Gem.ruby_version < Gem::Version.new("3.5.0.a") - bundle "config set console pry" + config "console pry" # make sure pry isn't there bundle "console" do |input, _, _| @@ -201,7 +201,7 @@ RSpec.describe "bundle console", readline: true do gem "foo" G - bundle "config set auto_install 1" + config "auto_install 1" bundle :console do |input, _, _| input.puts("puts 'hello'") input.puts("exit") diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb index 19e836053f..d6f0da77bd 100644 --- a/spec/bundler/commands/exec_spec.rb +++ b/spec/bundler/commands/exec_spec.rb @@ -582,7 +582,7 @@ RSpec.describe "bundle exec" do gem "foo" G - bundle "config set auto_install 1" + config "auto_install 1" bundle "exec myrackup", artifice: "compact_index" expect(out).to include("Installing foo 1.0") end @@ -597,7 +597,7 @@ RSpec.describe "bundle exec" do gem "foo", :git => "#{lib_path("foo-1.0")}" G - bundle "config set auto_install 1" + config "auto_install 1" bundle "exec foo", artifice: "compact_index" expect(out).to include("Fetching myrack 0.9.1") expect(out).to include("Fetching #{lib_path("foo-1.0")}") @@ -617,7 +617,7 @@ RSpec.describe "bundle exec" do system_gems "optparse-999.999.998", gem_repo: gem_repo4 - bundle "config set auto_install 1" + config "auto_install 1" bundle "config set --local path vendor/bundle" gemfile <<~G @@ -671,7 +671,7 @@ RSpec.describe "bundle exec" do end Bundler.rubygems.extend(Monkey) G - bundle "config set path.system true" + config "path.system true" bundle "install" bundle "exec ruby -e '`bundle -v`; puts $?.success?'", env: { "BUNDLER_VERSION" => Bundler::VERSION } expect(out).to match("true") @@ -951,7 +951,7 @@ RSpec.describe "bundle exec" do end before do - bundle "config set disable_exec_load true" + config "disable_exec_load true" end it "runs" do @@ -1088,7 +1088,7 @@ RSpec.describe "bundle exec" do source "https://gem.repo1" gem "myrack" G - bundle "config set path vendor/bundler" + config "path vendor/bundler" bundle :install end @@ -1155,8 +1155,8 @@ RSpec.describe "bundle exec" do end end - bundle "config set path vendor/bundle" - bundle "config set gemfile gemfiles/myrack_6_1.gemfile" + config "path vendor/bundle" + config "gemfile gemfiles/myrack_6_1.gemfile" gemfile(bundled_app("gemfiles/myrack_6_1.gemfile"), <<~RUBY) source "https://gem.repo2" diff --git a/spec/bundler/commands/fund_spec.rb b/spec/bundler/commands/fund_spec.rb index 6f4e61da30..7a8bb238f3 100644 --- a/spec/bundler/commands/fund_spec.rb +++ b/spec/bundler/commands/fund_spec.rb @@ -73,7 +73,7 @@ RSpec.describe "bundle fund" do end it "considers fund information for installed optional dependencies" do - bundle "config set with whatever" + config "with whatever" install_gemfile <<-G source "https://gem.repo2" diff --git a/spec/bundler/commands/info_spec.rb b/spec/bundler/commands/info_spec.rb index b60474310e..8b3140b8e9 100644 --- a/spec/bundler/commands/info_spec.rb +++ b/spec/bundler/commands/info_spec.rb @@ -235,7 +235,7 @@ RSpec.describe "bundle info" do context "with without configured" do it "does not find the gem, but gives a helpful error" do - bundle "config set without test" + config "without test" install_gemfile <<-G source "https://gem.repo1" diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 49541d9e73..ebf36d5100 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -917,7 +917,7 @@ RSpec.describe "bundle install with gem sources" do describe "when requesting a quiet install via --quiet" do it "should be quiet if there are no warnings" do - bundle "config set force_ruby_platform true" + config "force_ruby_platform true" gemfile <<-G source "https://gem.repo1" @@ -930,7 +930,7 @@ RSpec.describe "bundle install with gem sources" do end it "should still display warnings and errors" do - bundle "config set force_ruby_platform true" + config "force_ruby_platform true" create_file("install_with_warning.rb", <<~RUBY) require "#{lib_dir}/bundler" @@ -1291,7 +1291,7 @@ RSpec.describe "bundle install with gem sources" do source "https://gem.repo1" gem 'myrack' G - bundle "config set path vendor/bundle" + config "path vendor/bundle" bundle :install expect(out).to include("Bundle complete!") expect(err).to be_empty @@ -1654,7 +1654,7 @@ RSpec.describe "bundle install with gem sources" do end it "raises a clear error message when frozen" do - bundle "config set frozen true" + config "frozen true" bundle "install", raise_on_error: false expect(exitstatus).to eq(41) @@ -1666,7 +1666,7 @@ RSpec.describe "bundle install with gem sources" do missing_dep = "myrack (0.9.1)" expect(lockfile).not_to include(missing_dep) - bundle "config set frozen false" + config "frozen false" bundle :install expect(lockfile).to include(missing_dep) @@ -1694,7 +1694,7 @@ RSpec.describe "bundle install with gem sources" do context "with only option" do before do - bundle "config set only a:b" + config "only a:b" end it "installs only gems of the specified groups" do diff --git a/spec/bundler/commands/licenses_spec.rb b/spec/bundler/commands/licenses_spec.rb index bfec938efd..f771337c5d 100644 --- a/spec/bundler/commands/licenses_spec.rb +++ b/spec/bundler/commands/licenses_spec.rb @@ -30,7 +30,7 @@ RSpec.describe "bundle licenses" do gem "foo" G - bundle "config set auto_install 1" + config "auto_install 1" bundle :licenses expect(out).to include("Installing foo 1.0") end diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb index 8da007fcd6..df207303ec 100644 --- a/spec/bundler/commands/lock_spec.rb +++ b/spec/bundler/commands/lock_spec.rb @@ -677,8 +677,8 @@ RSpec.describe "bundle lock" do gem "thin" gem "myrack_middleware", :group => "test" G - bundle "config set without test" - bundle "config set path vendor/bundle" + config "without test" + config "path vendor/bundle" bundle "lock", verbose: true expect(bundled_app("vendor/bundle")).not_to exist end @@ -937,7 +937,7 @@ RSpec.describe "bundle lock" do platform_specific L - bundle "config set force_ruby_platform true" + config "force_ruby_platform true" bundle "lock --add-platform java x86-mingw32" allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) @@ -2195,7 +2195,7 @@ RSpec.describe "bundle lock" do end end - bundle "config set lockfile_checksums false" + config "lockfile_checksums false" simulate_platform "x86_64-linux" do install_gemfile <<-G @@ -2229,7 +2229,7 @@ RSpec.describe "bundle lock" do build_gem "warning", "18.0.0" end - bundle "config set lockfile_checksums false" + config "lockfile_checksums false" simulate_platform "x86_64-linux" do install_gemfile(<<-G, artifice: "endpoint") diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb index 15564544e3..81cc4b9889 100644 --- a/spec/bundler/commands/newgem_spec.rb +++ b/spec/bundler/commands/newgem_spec.rb @@ -744,7 +744,7 @@ RSpec.describe "bundle gem" do context "init_gems_rb setting to true" do before do - bundle "config set init_gems_rb true" + config "init_gems_rb true" bundle "gem #{gem_name}" end @@ -762,7 +762,7 @@ RSpec.describe "bundle gem" do context "init_gems_rb setting to false" do before do - bundle "config set init_gems_rb false" + config "init_gems_rb false" bundle "gem #{gem_name}" end @@ -780,7 +780,7 @@ RSpec.describe "bundle gem" do context "gem.test setting set to rspec" do before do - bundle "config set gem.test rspec" + config "gem.test rspec" bundle "gem #{gem_name}" end @@ -798,7 +798,7 @@ RSpec.describe "bundle gem" do context "gem.test setting set to rspec and --test is set to minitest" do before do - bundle "config set gem.test rspec" + config "gem.test rspec" bundle "gem #{gem_name} --test=minitest" end @@ -853,7 +853,7 @@ RSpec.describe "bundle gem" do context "gem.test setting set to minitest" do before do - bundle "config set gem.test minitest" + config "gem.test minitest" bundle "gem #{gem_name}" end @@ -929,7 +929,7 @@ RSpec.describe "bundle gem" do context "gem.test set to rspec and --test with no arguments" do before do - bundle "config set gem.test rspec" + config "gem.test rspec" bundle "gem #{gem_name} --test" end @@ -951,7 +951,7 @@ RSpec.describe "bundle gem" do context "gem.test setting set to false and --test with no arguments", :readline do before do - bundle "config set gem.test false" + config "gem.test false" bundle "gem #{gem_name} --test" do |input, _, _| input.puts end @@ -991,7 +991,7 @@ RSpec.describe "bundle gem" do context "gem.test setting set to a test framework and --no-test" do before do - bundle "config set gem.test rspec" + config "gem.test rspec" bundle "gem #{gem_name} --no-test" end @@ -1079,7 +1079,7 @@ RSpec.describe "bundle gem" do context "gem.ci setting set to github" do it "generates a GitHub Actions config file" do - bundle "config set gem.ci github" + config "gem.ci github" bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/.github/workflows/main.yml")).to exist @@ -1088,7 +1088,7 @@ RSpec.describe "bundle gem" do context "gem.ci setting set to gitlab" do it "generates a GitLab CI config file" do - bundle "config set gem.ci gitlab" + config "gem.ci gitlab" bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/.gitlab-ci.yml")).to exist @@ -1097,7 +1097,7 @@ RSpec.describe "bundle gem" do context "gem.ci setting set to circle" do it "generates a CircleCI config file" do - bundle "config set gem.ci circle" + config "gem.ci circle" bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/.circleci/config.yml")).to exist @@ -1106,7 +1106,7 @@ RSpec.describe "bundle gem" do context "gem.ci set to github and --ci with no arguments" do before do - bundle "config set gem.ci github" + config "gem.ci github" bundle "gem #{gem_name} --ci" end @@ -1121,7 +1121,7 @@ RSpec.describe "bundle gem" do context "gem.ci setting set to false and --ci with no arguments", :readline do before do - bundle "config set gem.ci false" + config "gem.ci false" bundle "gem #{gem_name} --ci" do |input, _, _| input.puts "github" end @@ -1157,7 +1157,7 @@ RSpec.describe "bundle gem" do context "gem.ci setting set to a CI service and --no-ci" do before do - bundle "config set gem.ci github" + config "gem.ci github" bundle "gem #{gem_name} --no-ci" end @@ -1245,7 +1245,7 @@ RSpec.describe "bundle gem" do context "gem.linter setting set to rubocop" do before do - bundle "config set gem.linter rubocop" + config "gem.linter rubocop" bundle "gem #{gem_name}" end @@ -1260,7 +1260,7 @@ RSpec.describe "bundle gem" do context "gem.linter setting set to standard" do before do - bundle "config set gem.linter standard" + config "gem.linter standard" bundle "gem #{gem_name}" end @@ -1275,7 +1275,7 @@ RSpec.describe "bundle gem" do context "gem.linter set to rubocop and --linter with no arguments" do before do - bundle "config set gem.linter rubocop" + config "gem.linter rubocop" bundle "gem #{gem_name} --linter" end @@ -1294,7 +1294,7 @@ RSpec.describe "bundle gem" do context "gem.linter setting set to false and --linter with no arguments", :readline do before do - bundle "config set gem.linter false" + config "gem.linter false" bundle "gem #{gem_name} --linter" do |input, _, _| input.puts "rubocop" end @@ -1330,7 +1330,7 @@ RSpec.describe "bundle gem" do context "gem.linter setting set to a linter and --no-linter" do before do - bundle "config set gem.linter rubocop" + config "gem.linter rubocop" bundle "gem #{gem_name} --no-linter" end diff --git a/spec/bundler/commands/open_spec.rb b/spec/bundler/commands/open_spec.rb index 77e7815017..2a993cbda3 100644 --- a/spec/bundler/commands/open_spec.rb +++ b/spec/bundler/commands/open_spec.rb @@ -139,7 +139,7 @@ RSpec.describe "bundle open" do gem "foo" G - bundle "config set auto_install 1" + config "auto_install 1" bundle "open rails", env: { "EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => "" } expect(out).to include("Installing foo 1.0") end diff --git a/spec/bundler/commands/outdated_spec.rb b/spec/bundler/commands/outdated_spec.rb index 80053617e5..a415e0ac28 100644 --- a/spec/bundler/commands/outdated_spec.rb +++ b/spec/bundler/commands/outdated_spec.rb @@ -120,7 +120,7 @@ RSpec.describe "bundle outdated" do end it "shows the location of the latest version's gemspec if installed" do - bundle "config set clean false" + config "clean false" update_repo2 { build_gem "activesupport", "3.0" } update_repo2 { build_gem "terranova", "9" } @@ -333,7 +333,7 @@ RSpec.describe "bundle outdated" do build_gem "activesupport", "2.3.4" end - bundle "config set clean false" + config "clean false" install_gemfile <<-G source "https://gem.repo2" @@ -748,7 +748,7 @@ RSpec.describe "bundle outdated" do gem "foo" G - bundle "config set auto_install 1" + config "auto_install 1" bundle :outdated, raise_on_error: false expect(out).to include("Installing foo 1.0") end @@ -764,7 +764,7 @@ RSpec.describe "bundle outdated" do gem "foo" G bundle :lock - bundle "config set deployment true" + config "deployment true" end it "outputs a helpful message about being in deployment mode" do diff --git a/spec/bundler/commands/post_bundle_message_spec.rb b/spec/bundler/commands/post_bundle_message_spec.rb index 9eecff593f..810bdb499b 100644 --- a/spec/bundler/commands/post_bundle_message_spec.rb +++ b/spec/bundler/commands/post_bundle_message_spec.rb @@ -124,7 +124,7 @@ RSpec.describe "post bundle message" do describe "with misspelled or non-existent gem name" do before do - bundle "config set force_ruby_platform true" + config "force_ruby_platform true" end it "should report a helpful error message" do diff --git a/spec/bundler/commands/show_spec.rb b/spec/bundler/commands/show_spec.rb index 34e809f135..b37700cd4d 100644 --- a/spec/bundler/commands/show_spec.rb +++ b/spec/bundler/commands/show_spec.rb @@ -179,7 +179,7 @@ RSpec.describe "bundle show" do gem "foo" G - bundle "config set auto_install 1" + config "auto_install 1" bundle :show expect(out).to include("Installing foo 1.0") end diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index 50d888e8b9..8dcbde9738 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -816,7 +816,7 @@ RSpec.describe "bundle update" do end it "should fail loudly" do - bundle "config set deployment true" + config "deployment true" bundle "update", all: true, raise_on_error: false expect(last_command).to be_failure @@ -1525,7 +1525,7 @@ RSpec.describe "bundle update --bundler" do end it "updates the bundler version in the lockfile even if the latest version is not installed", :ruby_repo do - bundle "config set path.system true" + config "path.system true" pristine_system_gems "bundler-9.0.0" diff --git a/spec/bundler/commands/version_spec.rb b/spec/bundler/commands/version_spec.rb index 8e2e1e8b96..1eb664905b 100644 --- a/spec/bundler/commands/version_spec.rb +++ b/spec/bundler/commands/version_spec.rb @@ -14,7 +14,7 @@ RSpec.describe "bundle version" do bundle "-v" expect(out).to eq(Bundler::VERSION.to_s) - bundle "config set simulate_version 5" + config "simulate_version 5" bundle "-v" expect(out).to eq("#{Bundler::VERSION} (simulating Bundler 5)") end @@ -25,7 +25,7 @@ RSpec.describe "bundle version" do bundle "--version" expect(out).to eq(Bundler::VERSION.to_s) - bundle "config set simulate_version 5" + config "simulate_version 5" bundle "--version" expect(out).to eq("#{Bundler::VERSION} (simulating Bundler 5)") end @@ -41,7 +41,7 @@ RSpec.describe "bundle version" do bundle "version" expect(out).to match(/\A4\.9\.9 \(2100-01-01 commit #{COMMIT_HASH}\)\z/) - bundle "config set simulate_version 5" + config "simulate_version 5" bundle "version" expect(out).to match(/\A4\.9\.9 \(simulating Bundler 5\) \(2100-01-01 commit #{COMMIT_HASH}\)\z/) end @@ -56,7 +56,7 @@ RSpec.describe "bundle version" do bundle "version" expect(out).to match(/\A4\.9\.9 \(20\d{2}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/) - bundle "config set simulate_version 5" + config "simulate_version 5" bundle "version" expect(out).to match(/\A4\.9\.9 \(simulating Bundler 5\) \(20\d{2}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/) end |
