diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-06-03 20:45:36 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-06-18 19:14:15 +0900 |
commit | 1436b5026cd1b2ac4b428955aeadaac8e8b12b1b (patch) | |
tree | 14f9fa8724d3a96b0b221a39d0e1cbd9cd125197 /spec/bundler/commands | |
parent | 481840ff18b2d66b20a42240829e06829c34f8f7 (diff) |
[rubygems/rubygems] s/bundle!/bundle
https://github.com/rubygems/rubygems/commit/746a4b3d74
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3212
Diffstat (limited to 'spec/bundler/commands')
23 files changed, 346 insertions, 346 deletions
diff --git a/spec/bundler/commands/add_spec.rb b/spec/bundler/commands/add_spec.rb index 4362e1e501..fd7c637c2c 100644 --- a/spec/bundler/commands/add_spec.rb +++ b/spec/bundler/commands/add_spec.rb @@ -152,7 +152,7 @@ RSpec.describe "bundle add" do describe "with --optimistic" do it "adds optimistic version" do - bundle! "add 'foo' --optimistic" + bundle "add 'foo' --optimistic" expect(bundled_app_gemfile.read).to include %(gem "foo", ">= 2.0") expect(the_bundle).to include_gems "foo 2.0" end @@ -160,7 +160,7 @@ RSpec.describe "bundle add" do describe "with --strict option" do it "adds strict version" do - bundle! "add 'foo' --strict" + bundle "add 'foo' --strict" expect(bundled_app_gemfile.read).to include %(gem "foo", "= 2.0") expect(the_bundle).to include_gems "foo 2.0" end @@ -168,7 +168,7 @@ RSpec.describe "bundle add" do describe "with no option" do it "adds pessimistic version" do - bundle! "add 'foo'" + bundle "add 'foo'" expect(bundled_app_gemfile.read).to include %(gem "foo", "~> 2.0") expect(the_bundle).to include_gems "foo 2.0" end @@ -184,7 +184,7 @@ RSpec.describe "bundle add" do context "multiple gems" do it "adds multiple gems to gemfile" do - bundle! "add bar baz" + bundle "add bar baz" expect(bundled_app_gemfile.read).to match(/gem "bar", "~> 0.12.3"/) expect(bundled_app_gemfile.read).to match(/gem "baz", "~> 1.2"/) @@ -242,7 +242,7 @@ RSpec.describe "bundle add" do describe "when a gem is added and cache exists" do it "caches all new dependencies added for the specified gem" do - bundle! :cache + bundle :cache bundle "add 'rack' --version=1.0.0" expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb index 79f990d127..8fb486744e 100644 --- a/spec/bundler/commands/binstubs_spec.rb +++ b/spec/bundler/commands/binstubs_spec.rb @@ -49,7 +49,7 @@ RSpec.describe "bundle binstubs <gem>" do gem "rails" G - bundle! :binstubs, :all => true + bundle :binstubs, :all => true expect(bundled_app("bin/rails")).to exist expect(bundled_app("bin/rake")).to exist @@ -114,7 +114,7 @@ RSpec.describe "bundle binstubs <gem>" do gem "rack" gem "prints_loaded_gems" G - bundle! "binstubs bundler rack prints_loaded_gems" + bundle "binstubs bundler rack prints_loaded_gems" end let(:system_bundler_version) { Bundler::VERSION } @@ -326,8 +326,8 @@ RSpec.describe "bundle binstubs <gem>" do gem "rails" G - bundle! "binstubs rack", :path => "exec" - bundle! :install + bundle "binstubs rack", :path => "exec" + bundle :install expect(bundled_app("exec/rails")).to exist end @@ -342,18 +342,18 @@ RSpec.describe "bundle binstubs <gem>" do end it "generates a standalone binstub" do - bundle! "binstubs rack --standalone" + bundle "binstubs rack --standalone" expect(bundled_app("bin/rackup")).to exist end it "generates a binstub that does not depend on rubygems or bundler" do - bundle! "binstubs rack --standalone" + bundle "binstubs rack --standalone" expect(File.read(bundled_app("bin/rackup"))).to_not include("Gem.bin_path") end context "when specified --path option" do it "generates a standalone binstub at the given path" do - bundle! "binstubs rack --standalone --path foo" + bundle "binstubs rack --standalone --path foo" expect(bundled_app("foo/rackup")).to exist end end diff --git a/spec/bundler/commands/cache_spec.rb b/spec/bundler/commands/cache_spec.rb index 8367e2af7f..5eb18a120f 100644 --- a/spec/bundler/commands/cache_spec.rb +++ b/spec/bundler/commands/cache_spec.rb @@ -56,7 +56,7 @@ RSpec.describe "bundle cache" do D bundle "config set cache_all true" - bundle! :cache + bundle :cache expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist expect(bundled_app("vendor/cache/nokogiri-1.4.2.gem")).to exist @@ -88,7 +88,7 @@ RSpec.describe "bundle cache" do D bundle "config set cache_all true" - bundle! :cache + bundle :cache expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist expect(bundled_app("vendor/cache/nokogiri-1.4.2.gem")).to exist @@ -133,7 +133,7 @@ RSpec.describe "bundle cache" do D bundle "config set cache_all true" - bundle! :cache + bundle :cache expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist expect(bundled_app("vendor/cache/nokogiri-1.4.2.gem")).to exist @@ -152,7 +152,7 @@ RSpec.describe "bundle cache" do gem 'rack' D - bundle! "cache --path #{bundled_app("test")}" + bundle "cache --path #{bundled_app("test")}" expect(the_bundle).to include_gems "rack 1.0.0" expect(bundled_app("test/vendor/cache/")).to exist @@ -166,7 +166,7 @@ RSpec.describe "bundle cache" do gem 'rack' D - bundle! "cache --no-install" + bundle "cache --no-install" expect(the_bundle).not_to include_gems "rack 1.0.0" expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist @@ -178,8 +178,8 @@ RSpec.describe "bundle cache" do gem 'rack' D - bundle! "cache --no-install" - bundle! "install" + bundle "cache --no-install" + bundle "install" expect(the_bundle).to include_gems "rack 1.0.0" end @@ -190,8 +190,8 @@ RSpec.describe "bundle cache" do gem "rack", "1.0.0" D - bundle! "cache --no-install" - bundle! "update --all" + bundle "cache --no-install" + bundle "update --all" expect(the_bundle).to include_gems "rack 1.0.0" end @@ -231,14 +231,14 @@ RSpec.describe "bundle cache" do end G - bundle! :cache, "all-platforms" => true + bundle :cache, "all-platforms" => true expect(bundled_app("vendor/cache/weakling-0.0.3.gem")).to exist expect(bundled_app("vendor/cache/uninstallable-2.0.gem")).to exist expect(the_bundle).to include_gem "rack 1.0" expect(the_bundle).not_to include_gems "weakling", "uninstallable" bundle "config --local without wo" - bundle! :install + bundle :install expect(the_bundle).to include_gem "rack 1.0" expect(the_bundle).not_to include_gems "weakling", "uninstallable" end @@ -259,7 +259,7 @@ RSpec.describe "bundle cache" do end it "tries to install with frozen" do - bundle! "config set deployment true" + bundle "config set deployment true" gemfile <<-G source "#{file_uri_for(gem_repo1)}" gem "rack" @@ -300,13 +300,13 @@ RSpec.describe "bundle install with gem sources" do gem "rack" G - bundle! :cache + bundle :cache simulate_new_machine FileUtils.rm_rf gem_repo2 bundle "config --local deployment true" bundle "config --local path vendor/bundle" - bundle! :install + bundle :install expect(the_bundle).to include_gems "rack 1.0.0" end diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index 81d0a3bc29..150118ad44 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -95,13 +95,13 @@ RSpec.describe "bundle check" do end G - bundle! "install --without foo" - bundle! "check" + bundle "install --without foo" + bundle "check" expect(out).to include("The Gemfile's dependencies are satisfied") end it "uses the without setting" do - bundle! "config set without foo" + bundle "config set without foo" install_gemfile! <<-G source "#{file_uri_for(gem_repo1)}" group :foo do @@ -109,7 +109,7 @@ RSpec.describe "bundle check" do end G - bundle! "check" + bundle "check" expect(out).to include("The Gemfile's dependencies are satisfied") end @@ -213,7 +213,7 @@ RSpec.describe "bundle check" do G bundle "config --local deployment true" - bundle! "install" + bundle "install" FileUtils.rm(bundled_app_lock) bundle :check, :raise_on_error => false @@ -233,13 +233,13 @@ RSpec.describe "bundle check" do end it "returns success" do - bundle! "check --path vendor/bundle" + bundle "check --path vendor/bundle" expect(out).to include("The Gemfile's dependencies are satisfied") end it "should write to .bundle/config" do bundle "check --path vendor/bundle" - bundle! "check" + bundle "check" end end @@ -324,7 +324,7 @@ RSpec.describe "bundle check" do context "is newer" do it "does not change the lock but warns" do lockfile lock_with(Bundler::VERSION.succ) - bundle! :check + bundle :check expect(err).to include("the running version of Bundler (#{Bundler::VERSION}) is older than the version that created the lockfile (#{Bundler::VERSION.succ})") lockfile_should_be lock_with(Bundler::VERSION.succ) end diff --git a/spec/bundler/commands/clean_spec.rb b/spec/bundler/commands/clean_spec.rb index 489f38e902..5036d8d491 100644 --- a/spec/bundler/commands/clean_spec.rb +++ b/spec/bundler/commands/clean_spec.rb @@ -27,16 +27,16 @@ RSpec.describe "bundle clean" do bundle "config set path vendor/bundle" bundle "config set clean false" - bundle! "install" + bundle "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" gem "thin" G - bundle! "install" + bundle "install" - bundle! :clean + bundle :clean expect(out).to include("Removing foo (1.0)") @@ -86,7 +86,7 @@ RSpec.describe "bundle clean" do bundle "config set path vendor/bundle" bundle "config set clean false" - bundle! "install" + bundle "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -94,9 +94,9 @@ RSpec.describe "bundle clean" do gem "rack", "0.9.1" gem "foo" G - bundle! "update rack" + bundle "update rack" - bundle! :clean + bundle :clean expect(out).to include("Removing rack (1.0.0)") @@ -234,13 +234,13 @@ RSpec.describe "bundle clean" do G bundle "config set path vendor/bundle" - bundle! "install" + bundle "install" update_git "foo", :path => lib_path("foo-bar") revision2 = revision_for(lib_path("foo-bar")) - bundle! "update", :all => true - bundle! :clean + bundle "update", :all => true + bundle :clean expect(out).to include("Removing foo-bar (#{revision[0..11]})") @@ -319,7 +319,7 @@ RSpec.describe "bundle clean" do end it "displays an error when used without --path" do - bundle! "config set path.system true" + bundle "config set path.system true" install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -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" + bundle "config set path.system true" install_gemfile! <<-G source "#{file_uri_for(gem_repo1)}" @@ -421,7 +421,7 @@ RSpec.describe "bundle clean" do build_gem "foo", "1.0.1" end - bundle! "update", :all => true + bundle "update", :all => true should_have_gems "foo-1.0.1" should_not_have_gems "foo-1.0" @@ -440,7 +440,7 @@ RSpec.describe "bundle clean" do build_gem "foo", "1.0.1" end - bundle! "update", :all => true + bundle "update", :all => true files = Pathname.glob(bundled_app(".bundle", Bundler.ruby_scope, "*", "*")) files.map! {|f| f.to_s.sub(bundled_app(".bundle", Bundler.ruby_scope).to_s, "") } @@ -480,18 +480,18 @@ RSpec.describe "bundle clean" do gem "foo" G bundle "config set path vendor/bundle" - bundle! "install" + bundle "install" update_repo2 do build_gem "foo", "1.0.1" end - bundle! :update, :all => true + bundle :update, :all => true should_have_gems "foo-1.0", "foo-1.0.1" end it "does not clean on bundle update when using --system" do - bundle! "config set path.system true" + bundle "config set path.system true" build_repo2 @@ -500,19 +500,19 @@ RSpec.describe "bundle clean" do gem "foo" G - bundle! "install" + bundle "install" update_repo2 do build_gem "foo", "1.0.1" end - bundle! :update, :all => true + bundle :update, :all => true gem_command! :list expect(out).to include("foo (1.0.1, 1.0)") end it "cleans system gems when --force is used" do - bundle! "config set path.system true" + bundle "config set path.system true" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -602,7 +602,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" + bundle "config set path.system true" build_repo2 update_repo2 do @@ -644,7 +644,7 @@ RSpec.describe "bundle clean" do bundle "config set path vendor/bundle" bundle "install" - bundle! :clean + bundle :clean end it "doesn't remove gems in dry-run mode with path set" do @@ -749,7 +749,7 @@ RSpec.describe "bundle clean" do bundle "config set path vendor/bundle" bundle "config set clean false" - bundle! "install" + bundle "install" gemfile <<-G source "#{file_uri_for(gem_repo1)}" @@ -758,8 +758,8 @@ RSpec.describe "bundle clean" do gem "weakling" G - bundle! "config set auto_install 1" - bundle! :clean + bundle "config set auto_install 1" + bundle :clean expect(out).to include("Installing weakling 0.0.3") should_have_gems "thin-1.0", "rack-1.0.0", "weakling-0.0.3" should_not_have_gems "foo-1.0" @@ -777,11 +777,11 @@ RSpec.describe "bundle clean" do G bundle "config set path vendor/bundle" - bundle! "install" + 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 - bundle! :clean + bundle :clean expect(out).to be_empty expect(vendored_gems("bundler/gems/extensions")).to exist @@ -798,7 +798,7 @@ RSpec.describe "bundle clean" do G bundle "config set path vendor/bundle" - bundle! "install" + bundle "install" very_simple_binary_extensions_dir = Pathname.glob("#{vendored_gems}/extensions/*/*/very_simple_binary-1.0").first @@ -816,8 +816,8 @@ RSpec.describe "bundle clean" do gem "simple_binary" G - bundle! "install" - bundle! :clean + bundle "install" + bundle :clean expect(out).to eq("Removing very_simple_binary (1.0)") expect(very_simple_binary_extensions_dir).not_to exist @@ -838,7 +838,7 @@ RSpec.describe "bundle clean" do G bundle "config set path vendor/bundle" - bundle! "install" + bundle "install" very_simple_binary_extensions_dir = Pathname.glob("#{vendored_gems}/bundler/gems/extensions/*/*/very_simple_git_binary-1.0-#{short_revision}").first @@ -849,16 +849,16 @@ RSpec.describe "bundle clean" do gem "very_simple_git_binary", :git => "#{lib_path("very_simple_git_binary-1.0")}", :ref => "#{revision}" G - bundle! "install" - bundle! :clean + bundle "install" + bundle :clean expect(out).to include("Removing thin (1.0)") expect(very_simple_binary_extensions_dir).to exist gemfile <<-G G - bundle! "install" - bundle! :clean + bundle "install" + bundle :clean expect(out).to eq("Removing very_simple_git_binary-1.0 (#{short_revision})") expect(very_simple_binary_extensions_dir).not_to exist @@ -881,8 +881,8 @@ RSpec.describe "bundle clean" do bundle :lock bundle "config set without development" bundle "config set path vendor/bundle" - bundle! "install" - bundle! :clean + bundle "install" + bundle :clean very_simple_binary_extensions_dir = Pathname.glob("#{vendored_gems}/bundler/gems/extensions/*/*/very_simple_git_binary-1.0-#{short_revision}").first diff --git a/spec/bundler/commands/config_spec.rb b/spec/bundler/commands/config_spec.rb index d7fb5107de..f1bc657ffb 100644 --- a/spec/bundler/commands/config_spec.rb +++ b/spec/bundler/commands/config_spec.rb @@ -91,7 +91,7 @@ RSpec.describe ".bundle/config" do end it "can also be set explicitly" do - bundle! "config set --global foo global" + bundle "config set --global foo global" run! "puts Bundler.settings[:foo]" expect(out).to eq("global") end @@ -401,42 +401,42 @@ E describe "subcommands" do it "list" do - bundle! "config list" + 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", :parseable => true + bundle "config list", :parseable => true expect(out).to eq "spec_run=true" end it "get" do ENV["BUNDLE_BAR"] = "bar_val" - bundle! "config get foo" + bundle "config get foo" expect(out).to eq "Settings for `foo` in order of priority. The top value will be used\nYou have not configured a value for `foo`" ENV["BUNDLE_FOO"] = "foo_val" - bundle! "config get foo --parseable" + bundle "config get foo --parseable" expect(out).to eq "foo=foo_val" - bundle! "config get foo" + bundle "config get foo" expect(out).to eq "Settings for `foo` in order of priority. The top value will be used\nSet via BUNDLE_FOO: \"foo_val\"" end it "set" do - bundle! "config set foo 1" + bundle "config set foo 1" expect(out).to eq "" - bundle! "config set --local foo 2" + bundle "config set --local foo 2" expect(out).to eq "" - bundle! "config set --global foo 3" + bundle "config set --global foo 3" expect(out).to eq "Your application has set foo to \"2\". This will override the global value you are currently setting" - bundle! "config set --parseable --local foo 4" + bundle "config set --parseable --local foo 4" expect(out).to eq "foo=4" - bundle! "config set --local foo 4.1" + bundle "config set --local foo 4.1" expect(out).to eq "You are replacing the current local value of foo, which is currently \"4\"" bundle "config set --global --local foo 5", :raise_on_error => false @@ -445,39 +445,39 @@ E end it "unset" do - bundle! "config unset foo" + bundle "config unset foo" expect(out).to eq "" - bundle! "config set foo 1" - bundle! "config unset foo --parseable" + bundle "config set foo 1" + bundle "config unset foo --parseable" expect(out).to eq "" - bundle! "config set --local foo 1" - bundle! "config set --global foo 2" + bundle "config set --local foo 1" + bundle "config set --global foo 2" - bundle! "config unset foo" + bundle "config unset foo" expect(out).to eq "" - expect(bundle!("config get foo")).to eq "Settings for `foo` in order of priority. The top value will be used\nYou have not configured a value for `foo`" + expect(bundle("config get foo")).to eq "Settings for `foo` in order of priority. The top value will be used\nYou have not configured a value for `foo`" - bundle! "config set --local foo 1" - bundle! "config set --global foo 2" + bundle "config set --local foo 1" + bundle "config set --global foo 2" - bundle! "config unset foo --local" + bundle "config unset foo --local" expect(out).to eq "" - expect(bundle!("config get foo")).to eq "Settings for `foo` in order of priority. The top value will be used\nSet for the current user (#{home(".bundle/config")}): \"2\"" - bundle! "config unset foo --global" + expect(bundle("config get foo")).to eq "Settings for `foo` in order of priority. The top value will be used\nSet for the current user (#{home(".bundle/config")}): \"2\"" + bundle "config unset foo --global" expect(out).to eq "" - expect(bundle!("config get foo")).to eq "Settings for `foo` in order of priority. The top value will be used\nYou have not configured a value for `foo`" + expect(bundle("config get foo")).to eq "Settings for `foo` in order of priority. The top value will be used\nYou have not configured a value for `foo`" - bundle! "config set --local foo 1" - bundle! "config set --global foo 2" + bundle "config set --local foo 1" + bundle "config set --global foo 2" - bundle! "config unset foo --global" + bundle "config unset foo --global" expect(out).to eq "" - expect(bundle!("config get foo")).to eq "Settings for `foo` in order of priority. The top value will be used\nSet for your local app (#{bundled_app(".bundle/config")}): \"1\"" - bundle! "config unset foo --local" + expect(bundle("config get foo")).to eq "Settings for `foo` in order of priority. The top value will be used\nSet for your local app (#{bundled_app(".bundle/config")}): \"1\"" + bundle "config unset foo --local" expect(out).to eq "" - expect(bundle!("config get foo")).to eq "Settings for `foo` in order of priority. The top value will be used\nYou have not configured a value for `foo`" + expect(bundle("config get foo")).to eq "Settings for `foo` in order of priority. The top value will be used\nYou have not configured a value for `foo`" bundle "config unset foo --local --global", :raise_on_error => false expect(last_command).to be_failure diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb index 748d951e8f..f30822c955 100644 --- a/spec/bundler/commands/exec_spec.rb +++ b/spec/bundler/commands/exec_spec.rb @@ -157,11 +157,11 @@ RSpec.describe "bundle exec" do gem "rack_two", "1.0.0" G - bundle! "exec rackup" + bundle "exec rackup" expect(out).to eq("0.9.1") - bundle! "exec rackup", :dir => bundled_app2 + bundle "exec rackup", :dir => bundled_app2 expect(out).to eq("1.0.0") end @@ -178,7 +178,7 @@ RSpec.describe "bundle exec" do end it "uses version provided by ruby" do - bundle! "exec irb --version" + bundle "exec irb --version" expect(out).to include(default_irb_version) end @@ -203,7 +203,7 @@ RSpec.describe "bundle exec" do end it "uses version specified" do - bundle! "exec irb --version" + bundle "exec irb --version" expect(out).to eq(specified_irb_version) expect(err).to be_empty @@ -231,7 +231,7 @@ RSpec.describe "bundle exec" do gem "gem_depending_on_old_irb" G - bundle! "exec irb --version" + bundle "exec irb --version" end it "uses resolved version" do @@ -260,7 +260,7 @@ RSpec.describe "bundle exec" do gem "rack_two", "1.0.0" G - bundle! "exec rackup" + bundle "exec rackup" expect(last_command.stderr).to eq( "Bundler is using a binstub that was created for a different gem (rack).\n" \ @@ -354,13 +354,13 @@ RSpec.describe "bundle exec" do end it "raises a helpful error when exec'ing to something outside of the bundle" do - bundle! "config set clean false" # want to keep the rackup binstub + bundle "config set clean false" # want to keep the rackup binstub install_gemfile! <<-G source "#{file_uri_for(gem_repo1)}" gem "with_license" G [true, false].each do |l| - bundle! "config set disable_exec_load #{l}" + bundle "config set disable_exec_load #{l}" bundle "exec rackup", :raise_on_error => false expect(err).to include "can't find executable rackup for gem rack. rack is not currently included in the bundle, perhaps you meant to add it to your Gemfile?" end @@ -598,8 +598,8 @@ RSpec.describe "bundle exec" do end Bundler.rubygems.extend(Monkey) G - bundle! "config set path.system true" - bundle! "install" + bundle "config set path.system true" + bundle "install" bundle "exec ruby -e '`bundle -v`; puts $?.success?'", :env => { "BUNDLER_VERSION" => Bundler::VERSION } expect(out).to match("true") end @@ -827,7 +827,7 @@ __FILE__: #{path.to_s.inspect} it "receives the signal" do skip "https://github.com/rubygems/bundler/issues/6898" if Gem.win_platform? - bundle!("exec #{path}") do |_, o, thr| + bundle("exec #{path}") do |_, o, thr| o.gets # Consumes 'Started' and ensures that thread has started Process.kill("INT", thr.pid) end @@ -854,7 +854,7 @@ __FILE__: #{path.to_s.inspect} Signal.trap(n, "IGNORE") end - bundle!("exec #{path}") + bundle("exec #{path}") expect(out).to eq(test_signals.count.to_s) end @@ -870,7 +870,7 @@ __FILE__: #{path.to_s.inspect} gem "rack" G bundle "config set path vendor/bundler" - bundle! :install + bundle :install end it "correctly shells out" do @@ -882,7 +882,7 @@ __FILE__: #{path.to_s.inspect} puts `bundle exec echo foo` RUBY file.chmod(0o777) - bundle! "exec #{file}", :env => { "PATH" => path } + bundle "exec #{file}", :env => { "PATH" => path } expect(out).to eq("foo") end end @@ -918,9 +918,9 @@ __FILE__: #{path.to_s.inspect} env = { "PATH" => path } aggregate_failures do - expect(bundle!("exec #{file}", :artifice => nil, :env => env)).to eq(expected) - expect(bundle!("exec bundle exec #{file}", :artifice => nil, :env => env)).to eq(expected) - expect(bundle!("exec ruby #{file}", :artifice => nil, :env => env)).to eq(expected) + expect(bundle("exec #{file}", :artifice => nil, :env => env)).to eq(expected) + expect(bundle("exec bundle exec #{file}", :artifice => nil, :env => env)).to eq(expected) + expect(bundle("exec ruby #{file}", :artifice => nil, :env => env)).to eq(expected) expect(run!(file.read, :artifice => nil, :env => env)).to eq(expected) end @@ -934,19 +934,19 @@ __FILE__: #{path.to_s.inspect} context "with a git gem that includes extensions", :ruby_repo do before do build_git "simple_git_binary", &:add_c_extension - bundle! "config set --local path .bundle" + bundle "config set --local path .bundle" install_gemfile! <<-G gem "simple_git_binary", :git => '#{lib_path("simple_git_binary-1.0")}' G end it "allows calling bundle install" do - bundle! "exec bundle install" + bundle "exec bundle install" end it "allows calling bundle install after removing gem.build_complete" do FileUtils.rm_rf Dir[bundled_app(".bundle/**/gem.build_complete")] - bundle! "exec #{Gem.ruby} -S bundle install" + bundle "exec #{Gem.ruby} -S bundle install" end end end diff --git a/spec/bundler/commands/info_spec.rb b/spec/bundler/commands/info_spec.rb index 7e1e41f9f4..2a52b5e0c0 100644 --- a/spec/bundler/commands/info_spec.rb +++ b/spec/bundler/commands/info_spec.rb @@ -13,13 +13,13 @@ RSpec.describe "bundle info" do it "creates a Gemfile.lock when invoked with a gem name" do FileUtils.rm(bundled_app_lock) - bundle! "info rails" + bundle "info rails" expect(bundled_app_lock).to exist end it "prints information if gem exists in bundle" do - bundle! "info rails" + bundle "info rails" expect(out).to include "* rails (2.3.2) \tSummary: This is just a fake gem for testing \tHomepage: http://example.com @@ -27,12 +27,12 @@ RSpec.describe "bundle info" do end it "prints path if gem exists in bundle" do - bundle! "info rails --path" + bundle "info rails --path" expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end it "prints the path to the running bundler" do - bundle! "info bundler --path" + bundle "info bundler --path" expect(out).to eq(root.to_s) end @@ -52,7 +52,7 @@ RSpec.describe "bundle info" do context "given a default gem shippped in ruby", :ruby_repo do it "prints information about the default gem" do - bundle! "info rdoc" + bundle "info rdoc" expect(out).to include("* rdoc") expect(out).to include("Default Gem: yes") end @@ -60,7 +60,7 @@ RSpec.describe "bundle info" do context "given a gem with metadata" do it "prints the gem metadata" do - bundle! "info has_metadata" + bundle "info has_metadata" expect(out).to include "* has_metadata (1.0) \tSummary: This is just a fake gem for testing \tHomepage: http://example.com @@ -101,7 +101,7 @@ RSpec.describe "bundle info" do G expect(the_bundle).to include_gems "foo 1.0" - bundle! "info foo" + bundle "info foo" expect(out).to include("foo (1.0 #{@git.ref_for("master", 6)}") end @@ -116,7 +116,7 @@ RSpec.describe "bundle info" do G expect(the_bundle).to include_gems "foo 1.0.omg" - bundle! "info foo" + bundle "info foo" expect(out).to include("foo (1.0 #{@git.ref_for("omg", 6)}") end @@ -126,7 +126,7 @@ RSpec.describe "bundle info" do gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{sha}" G - bundle! "info foo" + bundle "info foo" expect(out).to include("foo (1.0 #{sha[0..6]})") end @@ -137,7 +137,7 @@ RSpec.describe "bundle info" do G expect(the_bundle).to include_gems "foo 1.0.0.pre.beta.1" - bundle! "info foo" + bundle "info foo" expect(out).to include("foo (1.0.0.pre.beta.1") end end @@ -150,7 +150,7 @@ RSpec.describe "bundle info" do gem "rack-obama" G - bundle! "info rac" + bundle "info rac" expect(out).to eq "1 : rack\n2 : rack-obama\n0 : - exit -\n>" end end diff --git a/spec/bundler/commands/init_spec.rb b/spec/bundler/commands/init_spec.rb index 5f491a62c8..683a453c7d 100644 --- a/spec/bundler/commands/init_spec.rb +++ b/spec/bundler/commands/init_spec.rb @@ -2,7 +2,7 @@ RSpec.describe "bundle init" do it "generates a Gemfile" do - bundle! :init + bundle :init expect(out).to include("Writing new Gemfile") expect(bundled_app_gemfile).to be_file end @@ -28,11 +28,11 @@ RSpec.describe "bundle init" do let(:subdir) { "child_dir" } it "lets users generate a Gemfile in a child directory" do - bundle! :init + bundle :init FileUtils.mkdir bundled_app(subdir) - bundle! :init, :dir => bundled_app(subdir) + bundle :init, :dir => bundled_app(subdir) expect(out).to include("Writing new Gemfile") expect(bundled_app("#{subdir}/Gemfile")).to be_file @@ -99,7 +99,7 @@ RSpec.describe "bundle init" do before { bundle "config set init_gems_rb true" } it "generates a gems.rb" do - bundle! :init + bundle :init expect(out).to include("Writing new gems.rb") expect(bundled_app("gems.rb")).to be_file end @@ -125,11 +125,11 @@ RSpec.describe "bundle init" do let(:subdir) { "child_dir" } it "lets users generate a Gemfile in a child directory" do - bundle! :init + bundle :init FileUtils.mkdir bundled_app(subdir) - bundle! :init, :dir => bundled_app(subdir) + bundle :init, :dir => bundled_app(subdir) expect(out).to include("Writing new gems.rb") expect(bundled_app("#{subdir}/gems.rb")).to be_file diff --git a/spec/bundler/commands/inject_spec.rb b/spec/bundler/commands/inject_spec.rb index fa1bc8fd59..2d97bf6ff0 100644 --- a/spec/bundler/commands/inject_spec.rb +++ b/spec/bundler/commands/inject_spec.rb @@ -80,9 +80,9 @@ Usage: "bundle inject GEM VERSION" before do bundle "install" if Bundler.feature_flag.bundler_3_mode? - bundle! "config set --local deployment true" + bundle "config set --local deployment true" else - bundle! "config set --local frozen true" + bundle "config set --local frozen true" end end diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index f5e094dd7e..d277b8a1d7 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -35,7 +35,7 @@ RSpec.describe "bundle install with gem sources" do gem "rack" G - bundle! :install # can't use install_gemfile since it sets retry + bundle :install # can't use install_gemfile since it sets retry expect(bundled_app(".bundle")).not_to exist end @@ -45,7 +45,7 @@ RSpec.describe "bundle install with gem sources" do gem "rack" G - bundle! :install, :env => { "BUNDLE_PATH__SYSTEM" => "true" } # can't use install_gemfile since it sets retry + bundle :install, :env => { "BUNDLE_PATH__SYSTEM" => "true" } # can't use install_gemfile since it sets retry expect(bundled_app(".bundle")).not_to exist end @@ -562,11 +562,11 @@ RSpec.describe "bundle install with gem sources" do gem "rack" G bundle "config --local path bundle" - bundle! "install", :standalone => true + bundle "install", :standalone => true end it "includes the standalone path" do - bundle! "binstubs rack", :standalone => true + bundle "binstubs rack", :standalone => true standalone_line = File.read(bundled_app("bin/rackup")).each_line.find {|line| line.include? "$:.unshift" }.strip expect(standalone_line).to eq %($:.unshift File.expand_path "../../bundle", path.realpath) end diff --git a/spec/bundler/commands/list_spec.rb b/spec/bundler/commands/list_spec.rb index 1f622e5950..ed3edad163 100644 --- a/spec/bundler/commands/list_spec.rb +++ b/spec/bundler/commands/list_spec.rb @@ -30,7 +30,7 @@ RSpec.describe "bundle list" do context "when group is present" do it "prints the gems not in the specified group" do - bundle! "list --without-group test" + bundle "list --without-group test" expect(out).to include(" * rack (1.0.0)") expect(out).to include(" * rails (2.3.2)") @@ -48,7 +48,7 @@ RSpec.describe "bundle list" do context "when multiple groups" do it "prints the gems not in the specified groups" do - bundle! "list --without-group test production" + bundle "list --without-group test production" expect(out).to include(" * rack (1.0.0)") expect(out).not_to include(" * rails (2.3.2)") @@ -70,7 +70,7 @@ RSpec.describe "bundle list" do context "when group is present" do it "prints the gems in the specified group" do - bundle! "list --only-group default" + bundle "list --only-group default" expect(out).to include(" * rack (1.0.0)") expect(out).not_to include(" * rspec (1.2.7)") @@ -87,7 +87,7 @@ RSpec.describe "bundle list" do context "when multiple groups" do it "prints the gems in the specified groups" do - bundle! "list --only-group default production" + bundle "list --only-group default production" expect(out).to include(" * rack (1.0.0)") expect(out).to include(" * rails (2.3.2)") diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb index c7a1e39773..c97358c62d 100644 --- a/spec/bundler/commands/lock_spec.rb +++ b/spec/bundler/commands/lock_spec.rb @@ -78,7 +78,7 @@ RSpec.describe "bundle lock" do it "writes a lockfile when there is an outdated lockfile using --update" do lockfile @lockfile.gsub("2.3.2", "2.3.1") - bundle! "lock --update" + bundle "lock --update" expect(read_lockfile).to eq(@lockfile) end @@ -156,9 +156,9 @@ RSpec.describe "bundle lock" do gem "thin" gem "rack_middleware", :group => "test" G - bundle! "config set without test" - bundle! "config set path .bundle" - bundle! "lock" + bundle "config set without test" + bundle "config set path .bundle" + bundle "lock" expect(bundled_app(".bundle")).not_to exist end @@ -213,7 +213,7 @@ RSpec.describe "bundle lock" do end it "supports adding new platforms" do - bundle! "lock --add-platform java x86-mingw32" + bundle "lock --add-platform java x86-mingw32" allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) lockfile = Bundler::LockfileParser.new(read_lockfile) @@ -221,7 +221,7 @@ RSpec.describe "bundle lock" do end it "supports adding the `ruby` platform" do - bundle! "lock --add-platform ruby" + bundle "lock --add-platform ruby" allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) lockfile = Bundler::LockfileParser.new(read_lockfile) @@ -234,13 +234,13 @@ RSpec.describe "bundle lock" do end it "allows removing platforms" do - bundle! "lock --add-platform java x86-mingw32" + bundle "lock --add-platform java x86-mingw32" allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) lockfile = Bundler::LockfileParser.new(read_lockfile) expect(lockfile.platforms).to match_array(local_platforms.unshift(java, mingw).uniq) - bundle! "lock --remove-platform java" + bundle "lock --remove-platform java" lockfile = Bundler::LockfileParser.new(read_lockfile) expect(lockfile.platforms).to match_array(local_platforms.unshift(mingw).uniq) @@ -288,7 +288,7 @@ RSpec.describe "bundle lock" do gem "gssapi" G - simulate_platform(mingw) { bundle! :lock } + simulate_platform(mingw) { bundle :lock } lockfile_should_be <<-G GEM @@ -313,7 +313,7 @@ RSpec.describe "bundle lock" do #{Bundler::VERSION} G - simulate_platform(rb) { bundle! :lock } + simulate_platform(rb) { bundle :lock } lockfile_should_be <<-G GEM @@ -353,14 +353,14 @@ RSpec.describe "bundle lock" do end it "does not implicitly update" do - bundle! "lock" + bundle "lock" expect(read_lockfile).to eq(@lockfile) end it "accounts for changes in the gemfile" do gemfile gemfile.gsub('"foo"', '"foo", "2.0"') - bundle! "lock" + bundle "lock" expect(read_lockfile).to eq(@lockfile.sub("foo (1.0)", "foo (2.0)").sub(/foo$/, "foo (= 2.0)")) end diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb index 7cf5d1488d..f5958138e5 100644 --- a/spec/bundler/commands/newgem_spec.rb +++ b/spec/bundler/commands/newgem_spec.rb @@ -60,7 +60,7 @@ RSpec.describe "bundle gem" do describe "git repo initialization" do shared_examples_for "a gem with an initial git repo" do before do - bundle! "gem #{gem_name} #{flags}" + bundle "gem #{gem_name} #{flags}" end it "generates a gem skeleton with a .git folder", :readline do @@ -83,7 +83,7 @@ RSpec.describe "bundle gem" do context "when passing --no-git", :readline do before do - bundle! "gem #{gem_name} --no-git" + bundle "gem #{gem_name} --no-git" end it "generates a gem skeleton without a .git folder" do gem_skeleton_assertions @@ -94,7 +94,7 @@ RSpec.describe "bundle gem" do shared_examples_for "--mit flag" do before do - bundle! "gem #{gem_name} --mit" + bundle "gem #{gem_name} --mit" end it "generates a gem skeleton with MIT license" do gem_skeleton_assertions @@ -105,7 +105,7 @@ RSpec.describe "bundle gem" do shared_examples_for "--no-mit flag" do before do - bundle! "gem #{gem_name} --no-mit" + bundle "gem #{gem_name} --no-mit" end it "generates a gem skeleton without MIT license" do gem_skeleton_assertions @@ -115,7 +115,7 @@ RSpec.describe "bundle gem" do shared_examples_for "--coc flag" do before do - bundle! "gem #{gem_name} --coc" + bundle "gem #{gem_name} --coc" end it "generates a gem skeleton with MIT license" do gem_skeleton_assertions @@ -132,7 +132,7 @@ RSpec.describe "bundle gem" do shared_examples_for "--no-coc flag" do before do - bundle! "gem #{gem_name} --no-coc" + bundle "gem #{gem_name} --no-coc" end it "generates a gem skeleton without Code of Conduct" do gem_skeleton_assertions @@ -149,7 +149,7 @@ RSpec.describe "bundle gem" do shared_examples_for "--rubocop flag" do before do - bundle! "gem #{gem_name} --rubocop" + bundle "gem #{gem_name} --rubocop" end it "generates a gem skeleton with rubocop" do @@ -175,7 +175,7 @@ RSpec.describe "bundle gem" do define_negated_matcher :exclude, :include before do - bundle! "gem #{gem_name} --no-rubocop" + bundle "gem #{gem_name} --no-rubocop" end it "generates a gem skeleton without rubocop" do @@ -216,7 +216,7 @@ RSpec.describe "bundle gem" do context "README.md", :readline do context "git config github.user present" do before do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" end it "contribute URL set to git username" do @@ -228,7 +228,7 @@ RSpec.describe "bundle gem" do context "git config github.user is absent" do before do sys_exec("git config --unset github.user") - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" end it "contribute URL set to [USERNAME]" do @@ -239,7 +239,7 @@ RSpec.describe "bundle gem" do end it "creates a new git repository", :readline do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/.git")).to exist end @@ -266,14 +266,14 @@ RSpec.describe "bundle gem" do end it "generates a valid gemspec", :readline, :ruby_repo do - bundle! "gem newgem --bin" + bundle "gem newgem --bin" prepare_gemspec(bundled_app("newgem", "newgem.gemspec")) gems = ["rake-13.0.1"] path = Bundler.feature_flag.default_install_uses_path? ? local_gem_path(:base => bundled_app("newgem")) : system_gem_path system_gems gems, :path => path - bundle! "exec rake build", :dir => bundled_app("newgem") + bundle "exec rake build", :dir => bundled_app("newgem") expect(last_command.stdboth).not_to include("ERROR") end @@ -282,7 +282,7 @@ RSpec.describe "bundle gem" do it "resolves ." do create_temporary_dir("tmp") - bundle! "gem .", :dir => bundled_app("tmp") + bundle "gem .", :dir => bundled_app("tmp") expect(bundled_app("tmp/lib/tmp.rb")).to exist end @@ -290,7 +290,7 @@ RSpec.describe "bundle gem" do it "resolves .." do create_temporary_dir("temp/empty_dir") - bundle! "gem ..", :dir => bundled_app("temp/empty_dir") + bundle "gem ..", :dir => bundled_app("temp/empty_dir") expect(bundled_app("temp/lib/temp.rb")).to exist end @@ -298,7 +298,7 @@ RSpec.describe "bundle gem" do it "resolves relative directory" do create_temporary_dir("tmp/empty/tmp") - bundle! "gem ../../empty", :dir => bundled_app("tmp/empty/tmp") + bundle "gem ../../empty", :dir => bundled_app("tmp/empty/tmp") expect(bundled_app("tmp/empty/lib/empty.rb")).to exist end @@ -310,7 +310,7 @@ RSpec.describe "bundle gem" do shared_examples_for "generating a gem" do it "generates a gem skeleton" do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/#{gem_name}.gemspec")).to exist expect(bundled_app("#{gem_name}/Gemfile")).to exist @@ -326,14 +326,14 @@ RSpec.describe "bundle gem" do end it "starts with version 0.1.0" do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/lib/#{require_path}/version.rb").read).to match(/VERSION = "0.1.0"/) end context "git config user.{name,email} is set" do before do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" end it_should_behave_like "git config is present" @@ -343,21 +343,21 @@ RSpec.describe "bundle gem" do before do sys_exec("git config --unset user.name", :dir => bundled_app) sys_exec("git config --unset user.email", :dir => bundled_app) - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" end it_should_behave_like "git config is absent" end it "sets gemspec metadata['allowed_push_host']" do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" expect(generated_gemspec.metadata["allowed_push_host"]). to match(/mygemserver\.com/) end it "sets a minimum ruby version" do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" bundler_gemspec = Bundler::GemHelper.new(gemspec_dir).gemspec @@ -365,19 +365,19 @@ RSpec.describe "bundle gem" do end it "requires the version file" do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/lib/#{require_path}.rb").read).to match(%r{require "#{require_path}/version"}) end it "creates a base error class" do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/lib/#{require_path}.rb").read).to match(/class Error < StandardError; end$/) end it "runs rake without problems" do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" system_gems ["rake-13.0.1"] @@ -396,7 +396,7 @@ RSpec.describe "bundle gem" do context "--exe parameter set" do before do - bundle! "gem #{gem_name} --exe" + bundle "gem #{gem_name} --exe" end it "builds exe skeleton" do @@ -410,7 +410,7 @@ RSpec.describe "bundle gem" do context "--bin parameter set" do before do - bundle! "gem #{gem_name} --bin" + bundle "gem #{gem_name} --bin" end it "builds exe skeleton" do @@ -424,7 +424,7 @@ RSpec.describe "bundle gem" do context "no --test parameter" do before do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" end it_behaves_like "test framework is absent" @@ -432,7 +432,7 @@ RSpec.describe "bundle gem" do context "--test parameter set to rspec" do before do - bundle! "gem #{gem_name} --test=rspec" + bundle "gem #{gem_name} --test=rspec" end it "builds spec skeleton" do @@ -461,8 +461,8 @@ RSpec.describe "bundle gem" do context "gem.test setting set to rspec" do before do - bundle! "config set gem.test rspec" - bundle! "gem #{gem_name}" + bundle "config set gem.test rspec" + bundle "gem #{gem_name}" end it "builds spec skeleton" do @@ -474,8 +474,8 @@ 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" - bundle! "gem #{gem_name} --test=minitest" + bundle "config set gem.test rspec" + bundle "gem #{gem_name} --test=minitest" end it "builds spec skeleton" do @@ -486,7 +486,7 @@ RSpec.describe "bundle gem" do context "--test parameter set to minitest" do before do - bundle! "gem #{gem_name} --test=minitest" + bundle "gem #{gem_name} --test=minitest" end it "depends on a specific version of minitest" do @@ -518,8 +518,8 @@ RSpec.describe "bundle gem" do context "gem.test setting set to minitest" do before do - bundle! "config set gem.test minitest" - bundle! "gem #{gem_name}" + bundle "config set gem.test minitest" + bundle "gem #{gem_name}" end it "creates a default rake task to run the test suite" do @@ -542,7 +542,7 @@ RSpec.describe "bundle gem" do context "--test parameter set to test-unit" do before do - bundle! "gem #{gem_name} --test=test-unit" + bundle "gem #{gem_name} --test=test-unit" end it "depends on a specific version of test-unit" do @@ -574,8 +574,8 @@ RSpec.describe "bundle gem" do context "gem.test setting set to test-unit" do before do - bundle! "config set gem.test test-unit" - bundle! "gem #{gem_name}" + bundle "config set gem.test test-unit" + bundle "gem #{gem_name}" end it "creates a default rake task to run the test suite" do @@ -598,8 +598,8 @@ RSpec.describe "bundle gem" do context "gem.test set to rspec and --test with no arguments", :hint_text do before do - bundle! "config set gem.test rspec" - bundle! "gem #{gem_name} --test" + bundle "config set gem.test rspec" + bundle "gem #{gem_name} --test" end it "builds spec skeleton" do @@ -615,8 +615,8 @@ RSpec.describe "bundle gem" do context "gem.test setting set to false and --test with no arguments", :hint_text do before do - bundle! "config set gem.test false" - bundle! "gem #{gem_name} --test" + bundle "config set gem.test false" + bundle "gem #{gem_name} --test" end it "asks to generate test files" do @@ -632,7 +632,7 @@ RSpec.describe "bundle gem" do context "gem.test setting not set and --test with no arguments", :hint_text do before do - bundle! "gem #{gem_name} --test" + bundle "gem #{gem_name} --test" end it "asks to generate test files" do @@ -650,7 +650,7 @@ RSpec.describe "bundle gem" do context "--ci with no argument" do it "does not generate any CI config" do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/.github/workflows/main.yml")).to_not exist expect(bundled_app("#{gem_name}/.travis.yml")).to_not exist @@ -661,7 +661,7 @@ RSpec.describe "bundle gem" do context "--ci set to github" do it "generates a GitHub Actions config file" do - bundle! "gem #{gem_name} --ci=github" + bundle "gem #{gem_name} --ci=github" expect(bundled_app("#{gem_name}/.github/workflows/main.yml")).to exist end @@ -669,7 +669,7 @@ RSpec.describe "bundle gem" do context "--ci set to gitlab" do it "generates a GitLab CI config file" do - bundle! "gem #{gem_name} --ci=gitlab" + bundle "gem #{gem_name} --ci=gitlab" expect(bundled_app("#{gem_name}/.gitlab-ci.yml")).to exist end @@ -677,7 +677,7 @@ RSpec.describe "bundle gem" do context "--ci set to circle" do it "generates a CircleCI config file" do - bundle! "gem #{gem_name} --ci=circle" + bundle "gem #{gem_name} --ci=circle" expect(bundled_app("#{gem_name}/.circleci/config.yml")).to exist end @@ -685,7 +685,7 @@ RSpec.describe "bundle gem" do context "--ci set to travis" do it "generates a Travis CI config file" do - bundle! "gem #{gem_name} --ci=travis" + bundle "gem #{gem_name} --ci=travis" expect(bundled_app("#{gem_name}/.travis.yml")).to exist end @@ -702,8 +702,8 @@ 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" - bundle! "gem #{gem_name}" + bundle "config set gem.ci github" + bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/.github/workflows/main.yml")).to exist end @@ -711,8 +711,8 @@ RSpec.describe "bundle gem" do context "gem.ci setting set to travis" do it "generates a Travis CI config file" do - bundle! "config set gem.ci travis" - bundle! "gem #{gem_name}" + bundle "config set gem.ci travis" + bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/.travis.yml")).to exist end @@ -720,8 +720,8 @@ 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" - bundle! "gem #{gem_name}" + bundle "config set gem.ci gitlab" + bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/.gitlab-ci.yml")).to exist end @@ -729,8 +729,8 @@ 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" - bundle! "gem #{gem_name}" + bundle "config set gem.ci circle" + bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/.circleci/config.yml")).to exist end @@ -738,8 +738,8 @@ RSpec.describe "bundle gem" do context "gem.ci set to github and --ci with no arguments", :hint_text do before do - bundle! "config set gem.ci github" - bundle! "gem #{gem_name} --ci" + bundle "config set gem.ci github" + bundle "gem #{gem_name} --ci" end it "generates a GitHub Actions config file" do @@ -753,8 +753,8 @@ RSpec.describe "bundle gem" do context "gem.ci setting set to false and --ci with no arguments", :hint_text do before do - bundle! "config set gem.ci false" - bundle! "gem #{gem_name} --ci" + bundle "config set gem.ci false" + bundle "gem #{gem_name} --ci" end it "asks to setup CI" do @@ -768,7 +768,7 @@ RSpec.describe "bundle gem" do context "gem.ci setting not set and --ci with no arguments", :hint_text do before do - bundle! "gem #{gem_name} --ci" + bundle "gem #{gem_name} --ci" end it "asks to setup CI" do @@ -784,7 +784,7 @@ RSpec.describe "bundle gem" do context "--edit option" do it "opens the generated gemspec in the user's text editor" do - output = bundle! "gem #{gem_name} --edit=echo" + output = bundle "gem #{gem_name} --edit=echo" gemspec_path = File.join(bundled_app, gem_name, "#{gem_name}.gemspec") expect(output).to include("echo \"#{gemspec_path}\"") end @@ -853,7 +853,7 @@ RSpec.describe "bundle gem" do let(:flags) { nil } it "does not nest constants" do - bundle! ["gem", gem_name, flags].compact.join(" ") + bundle ["gem", gem_name, flags].compact.join(" ") expect(bundled_app("#{gem_name}/lib/#{require_path}/version.rb").read).to match(/module TestGem/) expect(bundled_app("#{gem_name}/lib/#{require_path}.rb").read).to match(/module TestGem/) end @@ -864,7 +864,7 @@ RSpec.describe "bundle gem" do let(:flags) { "--ext" } before do - bundle! ["gem", gem_name, flags].compact.join(" ") + bundle ["gem", gem_name, flags].compact.join(" ") end it "builds ext skeleton" do @@ -902,7 +902,7 @@ RSpec.describe "bundle gem" do let(:require_path) { "test/gem" } it "nests constants so they work" do - bundle! "gem #{gem_name}" + bundle "gem #{gem_name}" expect(bundled_app("#{gem_name}/lib/#{require_path}/version.rb").read).to match(/module Test\n module Gem/) expect(bundled_app("#{gem_name}/lib/#{require_path}.rb").read).to match(/module Test\n module Gem/) end @@ -912,7 +912,7 @@ RSpec.describe "bundle gem" do describe "uncommon gem names" do it "can deal with two dashes", :readline do - bundle! "gem a--a" + bundle "gem a--a" expect(bundled_app("a--a/a--a.gemspec")).to exist end @@ -971,7 +971,7 @@ Usage: "bundle gem NAME [OPTIONS]" it "asks about test framework" do global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__COC" => "false" - bundle! "gem foobar" do |input, _, _| + bundle "gem foobar" do |input, _, _| input.puts "rspec" end @@ -992,7 +992,7 @@ Usage: "bundle gem NAME [OPTIONS]" it "asks about CI service" do global_config "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__COC" => "false", "BUNDLE_GEM__RUBOCOP" => "false" - bundle! "gem foobar" do |input, _, _| + bundle "gem foobar" do |input, _, _| input.puts "github" end @@ -1002,9 +1002,9 @@ Usage: "bundle gem NAME [OPTIONS]" it "asks about MIT license" do global_config "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false", "BUNDLE_GEM__CI" => "false", "BUNDLE_GEM__RUBOCOP" => "false" - bundle! "config list" + bundle "config list" - bundle! "gem foobar" do |input, _, _| + bundle "gem foobar" do |input, _, _| input.puts "yes" end @@ -1014,7 +1014,7 @@ Usage: "bundle gem NAME [OPTIONS]" it "asks about CoC" do global_config "BUNDLE_GEM__MIT" => "false", "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__CI" => "false", "BUNDLE_GEM__RUBOCOP" => "false" - bundle! "gem foobar" do |input, _, _| + bundle "gem foobar" do |input, _, _| input.puts "yes" end @@ -1034,7 +1034,7 @@ Usage: "bundle gem NAME [OPTIONS]" context "on conflicts with a previously created directory", :readline do it "should succeed" do FileUtils.mkdir_p(bundled_app("conflict-foobar/Gemfile")) - bundle! "gem conflict-foobar" + bundle "gem conflict-foobar" expect(out).to include("file_clash conflict-foobar/Gemfile"). and include "Initializing git repo in #{bundled_app("conflict-foobar")}" end diff --git a/spec/bundler/commands/open_spec.rb b/spec/bundler/commands/open_spec.rb index 83839e4032..0688734b23 100644 --- a/spec/bundler/commands/open_spec.rb +++ b/spec/bundler/commands/open_spec.rb @@ -69,7 +69,7 @@ RSpec.describe "bundle open" do it "allows selecting exit from many match gems", :readline do env = { "EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor" } - bundle! "open active", :env => env do |input, _, _| + bundle "open active", :env => env do |input, _, _| input.puts "0" end end diff --git a/spec/bundler/commands/outdated_spec.rb b/spec/bundler/commands/outdated_spec.rb index 9b4daa3866..a144ab7149 100644 --- a/spec/bundler/commands/outdated_spec.rb +++ b/spec/bundler/commands/outdated_spec.rb @@ -105,7 +105,7 @@ RSpec.describe "bundle outdated" do describe "with --verbose option" do it "shows the location of the latest version's gemspec if installed" do - bundle! "config set clean false" + bundle "config set clean false" update_repo2 { build_gem "activesupport", "3.0" } update_repo2 { build_gem "terranova", "9" } @@ -279,7 +279,7 @@ RSpec.describe "bundle outdated" do build_gem "activesupport", "2.3.4" end - bundle! "config set clean false" + bundle "config set clean false" install_gemfile <<-G source "#{file_uri_for(gem_repo2)}" @@ -565,7 +565,7 @@ RSpec.describe "bundle outdated" do gem "rack" gem "foo" G - bundle! "config set deployment true" + bundle "config set 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 d31818b1bd..2c965f0ddd 100644 --- a/spec/bundler/commands/post_bundle_message_spec.rb +++ b/spec/bundler/commands/post_bundle_message_spec.rb @@ -30,21 +30,21 @@ RSpec.describe "post bundle message" do expect(out).to include(installed_gems_stats) bundle "config --local without emo" - bundle! :install + bundle :install expect(out).to include(bundle_show_message) expect(out).to include("Gems in the group emo were not installed") expect(out).to include(bundle_complete_message) expect(out).to include(installed_gems_stats) bundle "config --local without emo test" - bundle! :install + bundle :install expect(out).to include(bundle_show_message) expect(out).to include("Gems in the groups emo and test were not installed") expect(out).to include(bundle_complete_message) expect(out).to include("4 Gemfile dependencies, 3 gems now installed.") bundle "config --local without emo obama test" - bundle! :install + bundle :install expect(out).to include(bundle_show_message) expect(out).to include("Gems in the groups emo, obama and test were not installed") expect(out).to include(bundle_complete_message) @@ -56,28 +56,28 @@ RSpec.describe "post bundle message" do it "shows proper messages according to the configured groups" do bundle "config --local path vendor" - bundle! :install + bundle :install expect(out).to include(bundle_show_path_message) expect(out).to_not include("Gems in the group") expect(out).to include(bundle_complete_message) bundle "config --local path vendor" bundle "config --local without emo" - bundle! :install + bundle :install expect(out).to include(bundle_show_path_message) expect(out).to include("Gems in the group emo were not installed") expect(out).to include(bundle_complete_message) bundle "config --local path vendor" bundle "config --local without emo test" - bundle! :install + bundle :install expect(out).to include(bundle_show_path_message) expect(out).to include("Gems in the groups emo and test were not installed") expect(out).to include(bundle_complete_message) bundle "config --local path vendor" bundle "config --local without emo obama test" - bundle! :install + bundle :install expect(out).to include(bundle_show_path_message) expect(out).to include("Gems in the groups emo, obama and test were not installed") expect(out).to include(bundle_complete_message) @@ -89,7 +89,7 @@ RSpec.describe "post bundle message" do it "shows proper messages according to the configured groups" do bundle "config --local path #{bundle_path}" - bundle! :install + bundle :install expect(out).to include("Bundled gems are installed into `./cache`") expect(out).to_not include("Gems in the group") expect(out).to include(bundle_complete_message) @@ -101,7 +101,7 @@ RSpec.describe "post bundle message" do it "shows proper messages according to the configured groups" do bundle "config --local path #{bundle_path}" - bundle! :install + bundle :install expect(out).to include("Bundled gems are installed into `#{tmp("not_bundled_app")}`") expect(out).to_not include("Gems in the group") expect(out).to include(bundle_complete_message) @@ -162,8 +162,8 @@ The source does not contain any versions of 'not-a-gem' end it "with --without one group" do - bundle! "install --without emo" - bundle! :install + bundle "install --without emo" + bundle :install expect(out).to include(bundle_show_message) expect(out).to include("Gems in the group emo were not installed") expect(out).to include(bundle_complete_message) @@ -171,15 +171,15 @@ The source does not contain any versions of 'not-a-gem' end it "with --without two groups" do - bundle! "install --without emo test" - bundle! :install + bundle "install --without emo test" + bundle :install expect(out).to include(bundle_show_message) expect(out).to include("Gems in the groups emo and test were not installed") expect(out).to include(bundle_complete_message) end it "with --without more groups" do - bundle! "install --without emo obama test" + bundle "install --without emo obama test" bundle :install expect(out).to include(bundle_show_message) expect(out).to include("Gems in the groups emo, obama and test were not installed") @@ -189,25 +189,25 @@ The source does not contain any versions of 'not-a-gem' describe "for bundle update" do it "shows proper messages according to the configured groups" do - bundle! :update, :all => true + bundle :update, :all => true expect(out).not_to include("Gems in the groups") expect(out).to include(bundle_updated_message) bundle "config --local without emo" - bundle! :install - bundle! :update, :all => true + bundle :install + bundle :update, :all => true expect(out).to include("Gems in the group emo were not updated") expect(out).to include(bundle_updated_message) bundle "config --local without emo test" - bundle! :install - bundle! :update, :all => true + bundle :install + bundle :update, :all => true expect(out).to include("Gems in the groups emo and test were not updated") expect(out).to include(bundle_updated_message) bundle "config --local without emo obama test" - bundle! :install - bundle! :update, :all => true + bundle :install + bundle :update, :all => true expect(out).to include("Gems in the groups emo, obama and test were not updated") expect(out).to include(bundle_updated_message) end diff --git a/spec/bundler/commands/pristine_spec.rb b/spec/bundler/commands/pristine_spec.rb index b880477eea..4375ce93e3 100644 --- a/spec/bundler/commands/pristine_spec.rb +++ b/spec/bundler/commands/pristine_spec.rb @@ -45,9 +45,9 @@ RSpec.describe "bundle pristine", :ruby_repo do end it "does not delete the bundler gem" do - bundle! "install" - bundle! "pristine" - bundle! "-v" + bundle "install" + bundle "pristine" + bundle "-v" expected = if Bundler::VERSION < "3.0" "Bundler version" @@ -68,7 +68,7 @@ RSpec.describe "bundle pristine", :ruby_repo do File.open(changed_file, "a") {|f| f.puts diff } expect(File.read(changed_file)).to include(diff) - bundle! "pristine" + bundle "pristine" expect(File.read(changed_file)).to_not include(diff) end @@ -79,7 +79,7 @@ RSpec.describe "bundle pristine", :ruby_repo do FileUtils.touch(changes_txt) expect(changes_txt).to be_file - bundle! "pristine" + bundle "pristine" expect(changes_txt).not_to be_file end @@ -153,7 +153,7 @@ RSpec.describe "bundle pristine", :ruby_repo do FileUtils.touch(weakling_changes_txt) expect(weakling_changes_txt).to be_file - bundle! "pristine foo bar weakling" + bundle "pristine foo bar weakling" expect(err).to include("Cannot pristine bar (1.0). Gem is sourced from local path.") expect(out).to include("Installing weakling 1.0") @@ -178,7 +178,7 @@ RSpec.describe "bundle pristine", :ruby_repo do # This just verifies that the generated Makefile from the c_ext gem makes # use of the build_args from the bundle config it "applies the config when installing the gem" do - bundle! "pristine" + bundle "pristine" makefile_contents = File.read(c_ext_dir.join("Makefile").to_s) expect(makefile_contents).to match(/libpath =.*#{c_ext_dir}/) @@ -195,7 +195,7 @@ RSpec.describe "bundle pristine", :ruby_repo do # This just verifies that the generated Makefile from the c_ext gem makes # use of the build_args from the bundle config it "applies the config when installing the gem" do - bundle! "pristine" + bundle "pristine" makefile_contents = File.read(c_ext_dir.join("Makefile").to_s) expect(makefile_contents).to match(/libpath =.*#{c_ext_dir}/) diff --git a/spec/bundler/commands/remove_spec.rb b/spec/bundler/commands/remove_spec.rb index 04e0aeda82..bee4490a8d 100644 --- a/spec/bundler/commands/remove_spec.rb +++ b/spec/bundler/commands/remove_spec.rb @@ -21,7 +21,7 @@ RSpec.describe "bundle remove" do gem "rack" G - bundle! "remove rack --install" + bundle "remove rack --install" expect(out).to include("rack was removed.") expect(the_bundle).to_not include_gems "rack" @@ -37,7 +37,7 @@ RSpec.describe "bundle remove" do gem "rack" G - bundle! "remove rack" + bundle "remove rack" expect(out).to include("rack was removed.") gemfile_should_be <<-G @@ -57,7 +57,7 @@ RSpec.describe "bundle remove" do gem 'nokogiri' G - bundle! "remove rack" + bundle "remove rack" expect(out).to include("rack was removed.") gemfile_should_be <<-G @@ -93,7 +93,7 @@ RSpec.describe "bundle remove" do gem "rails" G - bundle! "remove rack rails" + bundle "remove rack rails" expect(out).to include("rack was removed.") expect(out).to include("rails was removed.") @@ -135,7 +135,7 @@ RSpec.describe "bundle remove" do gem "rack", :group => [:dev] G - bundle! "remove rack" + bundle "remove rack" expect(out).to include("rack was removed.") gemfile_should_be <<-G @@ -155,7 +155,7 @@ RSpec.describe "bundle remove" do end G - bundle! "remove rspec" + bundle "remove rspec" expect(out).to include("rspec was removed.") gemfile_should_be <<-G @@ -175,7 +175,7 @@ RSpec.describe "bundle remove" do end G - bundle! "remove rack" + bundle "remove rack" expect(out).to include("rack was removed.") gemfile_should_be <<-G @@ -201,7 +201,7 @@ RSpec.describe "bundle remove" do end G - bundle! "remove rspec" + bundle "remove rspec" expect(out).to include("rspec was removed.") gemfile_should_be <<-G @@ -220,7 +220,7 @@ RSpec.describe "bundle remove" do end G - bundle! "remove rspec" + bundle "remove rspec" expect(out).to include("rspec was removed.") gemfile_should_be <<-G @@ -243,7 +243,7 @@ RSpec.describe "bundle remove" do end G - bundle! "remove rspec" + bundle "remove rspec" expect(out).to include("rspec was removed.") gemfile_should_be <<-G @@ -266,7 +266,7 @@ RSpec.describe "bundle remove" do end G - bundle! "remove rspec" + bundle "remove rspec" expect(out).to include("rspec was removed.") gemfile_should_be <<-G @@ -289,7 +289,7 @@ RSpec.describe "bundle remove" do end G - bundle! "remove rspec" + bundle "remove rspec" expect(out).to include("rspec was removed.") gemfile_should_be <<-G @@ -316,7 +316,7 @@ RSpec.describe "bundle remove" do end G - bundle! "remove rspec" + bundle "remove rspec" expect(out).to include("rspec was removed.") gemfile_should_be <<-G @@ -360,7 +360,7 @@ RSpec.describe "bundle remove" do gem "minitest" G - bundle! "remove rails rack rspec minitest" + bundle "remove rails rack rspec minitest" expect(out).to include("rails was removed.") expect(out).to include("minitest was removed.") @@ -392,9 +392,9 @@ RSpec.describe "bundle remove" do end G - bundle! "install" + bundle "install" - bundle! "remove rspec" + bundle "remove rspec" expect(out).to include("rspec was removed.") gemfile_should_be <<-G @@ -420,7 +420,7 @@ RSpec.describe "bundle remove" do gem "rack" G - bundle! "remove rack" + bundle "remove rack" expect(out).to include("rack was removed.") end @@ -438,7 +438,7 @@ RSpec.describe "bundle remove" do eval_gemfile "Gemfile-other" G - bundle! "remove rack" + bundle "remove rack" expect(bundled_app("Gemfile-other").read).to_not include("gem \"rack\"") expect(out).to include("rack was removed.") @@ -553,7 +553,7 @@ RSpec.describe "bundle remove" do gem"rack" G - bundle! "remove rack" + bundle "remove rack" expect(out).to include("rack was removed.") expect(bundled_app("Gemfile-other").read).to_not include("gem \"rack\"") @@ -571,7 +571,7 @@ RSpec.describe "bundle remove" do end G - bundle! "remove rack" + bundle "remove rack" expect(out).to include("rack was removed.") gemfile_should_be <<-G @@ -590,7 +590,7 @@ RSpec.describe "bundle remove" do end G - bundle! "remove rack" + bundle "remove rack" expect(out).to include("rack was removed.") gemfile_should_be <<-G @@ -611,7 +611,7 @@ RSpec.describe "bundle remove" do gemspec :path => '#{tmp.join("foo")}', :name => 'foo' G - bundle! "remove foo" + bundle "remove foo" expect(out).to include("foo could not be removed.") end diff --git a/spec/bundler/commands/show_spec.rb b/spec/bundler/commands/show_spec.rb index 481d5ae6e6..177fb15c63 100644 --- a/spec/bundler/commands/show_spec.rb +++ b/spec/bundler/commands/show_spec.rb @@ -12,7 +12,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do it "creates a Gemfile.lock if one did not exist" do FileUtils.rm(bundled_app_lock) - bundle! "show" + bundle "show" expect(bundled_app_lock).to exist end @@ -20,18 +20,18 @@ RSpec.describe "bundle show", :bundler => "< 3" do it "creates a Gemfile.lock when invoked with a gem name" do FileUtils.rm(bundled_app_lock) - bundle! "show rails" + bundle "show rails" expect(bundled_app_lock).to exist end it "prints path if gem exists in bundle" do - bundle! "show rails" + bundle "show rails" expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end it "prints path if gem exists in bundle (with --paths option)" do - bundle! "show rails --paths" + bundle "show rails --paths" expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end @@ -45,7 +45,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "prints the path to the running bundler" do - bundle! "show bundler" + bundle "show bundler" expect(out).to eq(root.to_s) end @@ -55,7 +55,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "prints path of all gems in bundle sorted by name" do - bundle! "show --paths" + bundle "show --paths" expect(out).to include(default_bundle_path("gems", "rake-13.0.1").to_s) expect(out).to include(default_bundle_path("gems", "rails-2.3.2").to_s) @@ -66,7 +66,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "prints summary of gems" do - bundle! "show --verbose" + bundle "show --verbose" expect(out).to include <<~MSG * actionmailer (2.3.2) @@ -77,7 +77,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do end it "includes bundler in the summary of gems" do - bundle! "show --verbose" + bundle "show --verbose" expect(out).to include <<~MSG * bundler (#{Bundler::VERSION}) @@ -99,7 +99,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do G expect(the_bundle).to include_gems "foo 1.0" - bundle! :show + bundle :show expect(out).to include("foo (1.0 #{@git.ref_for("master", 6)}") end @@ -114,7 +114,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do G expect(the_bundle).to include_gems "foo 1.0.omg" - bundle! :show + bundle :show expect(out).to include("foo (1.0 #{@git.ref_for("omg", 6)}") end @@ -124,7 +124,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{sha}" G - bundle! :show + bundle :show expect(out).to include("foo (1.0 #{sha[0..6]})") end @@ -135,7 +135,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do G expect(the_bundle).to include_gems "foo 1.0.0.pre.beta.1" - bundle! :show + bundle :show expect(out).to include("foo (1.0.0.pre.beta.1") end end @@ -160,7 +160,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do G bundle "config set auto_install 1" - bundle! :show + bundle :show expect(out).to include("Installing foo 1.0") end @@ -172,7 +172,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do gem "rack-obama" G - bundle! "show rac" + bundle "show rac" expect(out).to eq "1 : rack\n2 : rack-obama\n0 : - exit -\n>" end end @@ -211,9 +211,9 @@ RSpec.describe "bundle show", :bundler => "< 3" do end end - bundle! "show --outdated" + bundle "show --outdated" - bundle! "install" + bundle "install" expect(the_bundle).to include_gem("rails 2.3.2") end end diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index 116bcfd18b..9a3bfd28c6 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -41,7 +41,7 @@ RSpec.describe "bundle update" do build_gem "activesupport", "3.0" end - bundle! "update", :all => true + bundle "update", :all => true expect(out).to include("Bundle updated!") expect(the_bundle).to include_gems "rack 1.2", "rack-obama 1.0", "activesupport 3.0" end @@ -65,14 +65,14 @@ RSpec.describe "bundle update" do gem "rack", "1.0" G - bundle! "update --gemfile OmgFile", :all => true + bundle "update --gemfile OmgFile", :all => true expect(bundled_app("OmgFile.lock")).to exist end end context "when update_requires_all_flag is set" do - before { bundle! "config set update_requires_all_flag true" } + before { bundle "config set update_requires_all_flag true" } it "errors when passed nothing" do install_gemfile! "" @@ -133,7 +133,7 @@ RSpec.describe "bundle update" do describe "when a possible resolve requires an older version of a locked gem" do context "and only_update_to_newer_versions is set" do before do - bundle! "config set only_update_to_newer_versions true" + bundle "config set only_update_to_newer_versions true" end it "does not go to an older version" do @@ -167,7 +167,7 @@ RSpec.describe "bundle update" do end end - bundle! "update", :all => true + bundle "update", :all => true expect(the_bundle).to include_gems("slim 3.0.9", "slim-rails 3.1.3", "slim_lint 0.16.1") end @@ -193,7 +193,7 @@ RSpec.describe "bundle update" do gem "b", "1.0" G - bundle! "update b" + bundle "update b" expect(the_bundle).to include_gems("a 1.0", "b 1.0") end @@ -281,7 +281,7 @@ RSpec.describe "bundle update" do describe "in a frozen bundle" do it "should fail loudly", :bundler => "< 3" do - bundle! "install --deployment" + bundle "install --deployment" bundle "update", :all => true, :raise_on_error => false expect(last_command).to be_failure @@ -290,14 +290,14 @@ RSpec.describe "bundle update" do end it "should suggest different command when frozen is set globally", :bundler => "< 3" do - bundle! "config set --global frozen 1" + bundle "config set --global frozen 1" bundle "update", :all => true, :raise_on_error => false expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m). and match(/freeze \nby running `bundle config unset frozen`./m) end it "should suggest different command when frozen is set globally", :bundler => "3" do - bundle! "config set --global deployment true" + bundle "config set --global deployment true" bundle "update", :all => true, :raise_on_error => false expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m). and match(/freeze \nby running `bundle config unset deployment`./m) @@ -312,7 +312,7 @@ RSpec.describe "bundle update" do G update_repo2 { build_gem "activesupport", "3.0" } - bundle! "update --source activesupport" + bundle "update --source activesupport" expect(the_bundle).to include_gem "activesupport 3.0" end @@ -323,12 +323,12 @@ RSpec.describe "bundle update" do G update_repo2 { build_gem "activesupport", "3.0" } - bundle! "update --source activesupport" + bundle "update --source activesupport" expect(the_bundle).not_to include_gem "activesupport 3.0" end context "with unlock_source_unlocks_spec set to false" do - before { bundle! "config set unlock_source_unlocks_spec false" } + before { bundle "config set unlock_source_unlocks_spec false" } it "should not update gems not included in the source that happen to have the same name" do install_gemfile <<-G @@ -468,7 +468,7 @@ RSpec.describe "bundle update in more complicated situations" do build_gem "rack", "10.0" end - bundle! "update thin rack-obama" + bundle "update thin rack-obama" expect(last_command.stdboth).to include "Bundler attempted to update rack-obama but its version stayed the same" expect(the_bundle).to include_gems "thin 2.0", "rack 10.0", "rack-obama 1.0" end @@ -484,7 +484,7 @@ RSpec.describe "bundle update in more complicated situations" do s.write "lib/foo2.rb", "puts :foo2" end - bundle! "update foo" + bundle "update foo" expect(last_command.stdboth).not_to include "attempted to update" end @@ -501,7 +501,7 @@ RSpec.describe "bundle update in more complicated situations" do gem "rack" G - bundle! "update rack" + bundle "update rack" expect(last_command.stdboth).not_to include "attempted to update" end @@ -554,12 +554,12 @@ RSpec.describe "bundle update in more complicated situations" do end it "allows updating" do - bundle! :update, :all => true + bundle :update, :all => true expect(the_bundle).to include_gem "a 1.1" end it "allows updating a specific gem" do - bundle! "update a" + bundle "update a" expect(the_bundle).to include_gem "a 1.1" end end @@ -593,7 +593,7 @@ RSpec.describe "bundle update in more complicated situations" do end it "is not updated because it is not actually included in the bundle" do - bundle! "update a" + bundle "update a" expect(last_command.stdboth).to include "Bundler attempted to update a but it was not considered because it is for a different platform from the current one" expect(the_bundle).to_not include_gem "a" end @@ -638,7 +638,7 @@ RSpec.describe "bundle update when a gem depends on a newer version of bundler" end it "should warn that the newer version of Bundler would conflict", :bundler => "3" do - bundle! "update", :all => true + bundle "update", :all => true expect(err).to include("rails (3.0.1) has dependency bundler"). and include("so the dependency is being ignored") expect(the_bundle).to include_gem "rails 3.0.1" @@ -666,7 +666,7 @@ RSpec.describe "bundle update" do end context "with suppress_install_using_messages set" do - before { bundle! "config set suppress_install_using_messages true" } + before { bundle "config set suppress_install_using_messages true" } it "only prints `Using` for versions that have changed" do build_repo4 do @@ -680,14 +680,14 @@ RSpec.describe "bundle update" do gem "foo" G - bundle! "update", :all => true + bundle "update", :all => true expect(out).to match(/Resolving dependencies\.\.\.\.*\nBundle updated!/) update_repo4 do build_gem "foo", "2.0" end - bundle! "update", :all => true + bundle "update", :all => true out.sub!("Removing foo (1.0)\n", "") expect(out).to match(/Resolving dependencies\.\.\.\.*\nFetching foo 2\.0 \(was 1\.0\)\nInstalling foo 2\.0 \(was 1\.0\)\nBundle updated/) end @@ -828,7 +828,7 @@ RSpec.describe "bundle update --bundler" do FileUtils.rm_r gem_repo4 - bundle! :update, :bundler => true, :verbose => true + bundle :update, :bundler => true, :verbose => true expect(the_bundle).to include_gem "rack 1.0" expect(the_bundle.locked_gems.bundler_version).to eq v(Bundler::VERSION) @@ -872,8 +872,8 @@ RSpec.describe "bundle update conservative" do context "with patch set as default update level in config" do it "should do a patch level update" do - bundle! "config set --local prefer_patch true" - bundle! "update foo" + bundle "config set --local prefer_patch true" + bundle "update foo" expect(the_bundle).to include_gems "foo 1.4.5", "bar 2.1.1", "qux 1.0.0" end @@ -881,13 +881,13 @@ RSpec.describe "bundle update conservative" do context "patch preferred" do it "single gem updates dependent gem to minor" do - bundle! "update --patch foo" + bundle "update --patch foo" expect(the_bundle).to include_gems "foo 1.4.5", "bar 2.1.1", "qux 1.0.0" end it "update all" do - bundle! "update --patch", :all => true + bundle "update --patch", :all => true expect(the_bundle).to include_gems "foo 1.4.5", "bar 2.1.1", "qux 1.0.1" end @@ -895,7 +895,7 @@ RSpec.describe "bundle update conservative" do context "minor preferred" do it "single gem updates dependent gem to major" do - bundle! "update --minor foo" + bundle "update --minor foo" expect(the_bundle).to include_gems "foo 1.5.1", "bar 3.0.0", "qux 1.0.0" end @@ -903,13 +903,13 @@ RSpec.describe "bundle update conservative" do context "strict" do it "patch preferred" do - bundle! "update --patch foo bar --strict" + bundle "update --patch foo bar --strict" expect(the_bundle).to include_gems "foo 1.4.4", "bar 2.0.5", "qux 1.0.0" end it "minor preferred" do - bundle! "update --minor --strict", :all => true + bundle "update --minor --strict", :all => true expect(the_bundle).to include_gems "foo 1.5.0", "bar 2.1.1", "qux 1.1.0" end diff --git a/spec/bundler/commands/version_spec.rb b/spec/bundler/commands/version_spec.rb index 8eecd9c53e..53d545f5fa 100644 --- a/spec/bundler/commands/version_spec.rb +++ b/spec/bundler/commands/version_spec.rb @@ -11,36 +11,36 @@ RSpec.describe "bundle version" do context "with -v" do it "outputs the version", :bundler => "< 3" do - bundle! "-v" + bundle "-v" expect(out).to eq("Bundler version #{Bundler::VERSION}") end it "outputs the version", :bundler => "3" do - bundle! "-v" + bundle "-v" expect(out).to eq(Bundler::VERSION) end end context "with --version" do it "outputs the version", :bundler => "< 3" do - bundle! "--version" + bundle "--version" expect(out).to eq("Bundler version #{Bundler::VERSION}") end it "outputs the version", :bundler => "3" do - bundle! "--version" + bundle "--version" expect(out).to eq(Bundler::VERSION) end end context "with version" do it "outputs the version with build metadata", :bundler => "< 3" do - bundle! "version" + bundle "version" expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/) end it "outputs the version with build metadata", :bundler => "3" do - bundle! "version" + bundle "version" expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/) end end diff --git a/spec/bundler/commands/viz_spec.rb b/spec/bundler/commands/viz_spec.rb index 8d4f49df9f..0efb24b504 100644 --- a/spec/bundler/commands/viz_spec.rb +++ b/spec/bundler/commands/viz_spec.rb @@ -14,10 +14,10 @@ RSpec.describe "bundle viz", :bundler => "< 3", :if => Bundler.which("dot") do gem "rack-obama" G - bundle! "viz" + bundle "viz" expect(out).to include("gem_graph.png") - bundle! "viz", :format => "debug" + bundle "viz", :format => "debug" expect(out).to eq(strip_whitespace(<<-DOT).strip) digraph Gemfile { concentrate = "true"; @@ -48,10 +48,10 @@ RSpec.describe "bundle viz", :bundler => "< 3", :if => Bundler.which("dot") do gem "rack-obama" G - bundle! "viz" + bundle "viz" expect(out).to include("gem_graph.png") - bundle! "viz", :format => :debug, :version => true + bundle "viz", :format => :debug, :version => true expect(out).to eq(strip_whitespace(<<-EOS).strip) digraph Gemfile { concentrate = "true"; @@ -89,7 +89,7 @@ RSpec.describe "bundle viz", :bundler => "< 3", :if => Bundler.which("dot") do gem "rack-obama" G - bundle! "viz", :format => "debug" + bundle "viz", :format => "debug" expect(out).to eq(strip_whitespace(<<-DOT).strip) digraph Gemfile { concentrate = "true"; @@ -121,7 +121,7 @@ RSpec.describe "bundle viz", :bundler => "< 3", :if => Bundler.which("dot") do end G - bundle! "viz --without=rails" + bundle "viz --without=rails" expect(out).to include("gem_graph.png") end @@ -139,7 +139,7 @@ RSpec.describe "bundle viz", :bundler => "< 3", :if => Bundler.which("dot") do end G - bundle! "viz --without=rails:rack" + bundle "viz --without=rails:rack" expect(out).to include("gem_graph.png") end end |