diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-11 23:09:33 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-12 10:44:54 +0200 |
commit | eb46c21d28193e1fc40aad1ab1316479f59f4515 (patch) | |
tree | 6f6a6ca1a853d7b29571d38f1e283624bb30728d /spec/commands | |
parent | bb0e13d6070a3082b7ef59cd8c7284f988335e91 (diff) | |
download | bundler-eb46c21d28193e1fc40aad1ab1316479f59f4515.tar.gz |
Unify stderr helpers
Diffstat (limited to 'spec/commands')
-rw-r--r-- | spec/commands/add_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/binstubs_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/check_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/config_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/init_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/install_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/lock_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 10 | ||||
-rw-r--r-- | spec/commands/update_spec.rb | 6 |
9 files changed, 17 insertions, 17 deletions
diff --git a/spec/commands/add_spec.rb b/spec/commands/add_spec.rb index dac1d0f6b9..7d435916db 100644 --- a/spec/commands/add_spec.rb +++ b/spec/commands/add_spec.rb @@ -21,7 +21,7 @@ RSpec.describe "bundle add" do it "shows error" do bundle "add" - expect(last_command.bundler_err).to include("Please specify gems to add") + expect(err).to include("Please specify gems to add") end end diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb index 3f62f17b45..ce9eba248c 100644 --- a/spec/commands/binstubs_spec.rb +++ b/spec/commands/binstubs_spec.rb @@ -70,7 +70,7 @@ RSpec.describe "bundle binstubs <gem>" do bundle "binstubs rack", :all => true expect(last_command).to be_failure - expect(last_command.bundler_err).to include("Cannot specify --all with specific gems") + expect(err).to include("Cannot specify --all with specific gems") end context "when generating bundle binstub outside bundler" do diff --git a/spec/commands/check_spec.rb b/spec/commands/check_spec.rb index 7114610644..cf88736612 100644 --- a/spec/commands/check_spec.rb +++ b/spec/commands/check_spec.rb @@ -338,7 +338,7 @@ RSpec.describe "bundle check" do it "does not change the lock but warns" do lockfile lock_with(Bundler::VERSION.succ) bundle! :check - expect(last_command.bundler_err).to include("the running version of Bundler (#{Bundler::VERSION}) is older than the version that created the lockfile (#{Bundler::VERSION.succ})") + 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 end diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb index 84f882b410..0ecd61183b 100644 --- a/spec/commands/config_spec.rb +++ b/spec/commands/config_spec.rb @@ -430,7 +430,7 @@ E bundle "config set --global --local foo 5" expect(last_command).to be_failure - expect(last_command.bundler_err).to eq "The options global and local were specified. Please only use one of the switches at a time." + expect(err).to eq "The options global and local were specified. Please only use one of the switches at a time." end it "unset" do @@ -470,7 +470,7 @@ E bundle "config unset foo --local --global" expect(last_command).to be_failure - expect(last_command.bundler_err).to eq "The options global and local were specified. Please only use one of the switches at a time." + expect(err).to eq "The options global and local were specified. Please only use one of the switches at a time." end end end diff --git a/spec/commands/init_spec.rb b/spec/commands/init_spec.rb index 64849beeb9..7960ce85bd 100644 --- a/spec/commands/init_spec.rb +++ b/spec/commands/init_spec.rb @@ -94,7 +94,7 @@ RSpec.describe "bundle init" do end bundle :init, :gemspec => spec_file - expect(last_command.bundler_err).to include("There was an error while loading `test.gemspec`") + expect(err).to include("There was an error while loading `test.gemspec`") end end end diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb index 21157dd309..1a027a77c9 100644 --- a/spec/commands/install_spec.rb +++ b/spec/commands/install_spec.rb @@ -16,7 +16,7 @@ RSpec.describe "bundle install with gem sources" do raise StandardError, "FAIL" G - expect(last_command.bundler_err).to include('StandardError, "FAIL"') + expect(err).to include('StandardError, "FAIL"') expect(bundled_app("Gemfile.lock")).not_to exist end @@ -404,7 +404,7 @@ RSpec.describe "bundle install with gem sources" do G expect(last_command.stdboth).not_to match(/Error Report/i) - expect(last_command.bundler_err).to include("An error occurred while installing ajp-rails (0.0.0), and Bundler cannot continue."). + expect(err).to include("An error occurred while installing ajp-rails (0.0.0), and Bundler cannot continue."). and include(normalize_uri_file("Make sure that `gem install ajp-rails -v '0.0.0' --source 'file://localhost#{gem_repo2}/'` succeeds before bundling.")) end diff --git a/spec/commands/lock_spec.rb b/spec/commands/lock_spec.rb index f876d719cc..7aaf5c178e 100644 --- a/spec/commands/lock_spec.rb +++ b/spec/commands/lock_spec.rb @@ -242,7 +242,7 @@ RSpec.describe "bundle lock" do it "errors when removing all platforms" do bundle "lock --remove-platform #{local_platforms.join(" ")}" - expect(last_command.bundler_err).to include("Removing all platforms from the bundle is not allowed") + expect(err).to include("Removing all platforms from the bundle is not allowed") end # from https://github.com/bundler/bundler/issues/4896 diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 0d1058ad11..104d616d24 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -770,22 +770,22 @@ RSpec.describe "bundle gem" do it "fails gracefully with a ." do bundle "gem foo.gemspec" - expect(last_command.bundler_err).to end_with("Invalid gem name foo.gemspec -- `Foo.gemspec` is an invalid constant name") + expect(err).to end_with("Invalid gem name foo.gemspec -- `Foo.gemspec` is an invalid constant name") end it "fails gracefully with a ^" do bundle "gem ^" - expect(last_command.bundler_err).to end_with("Invalid gem name ^ -- `^` is an invalid constant name") + expect(err).to end_with("Invalid gem name ^ -- `^` is an invalid constant name") end it "fails gracefully with a space" do bundle "gem 'foo bar'" - expect(last_command.bundler_err).to end_with("Invalid gem name foo bar -- `Foo bar` is an invalid constant name") + expect(err).to end_with("Invalid gem name foo bar -- `Foo bar` is an invalid constant name") end it "fails gracefully when multiple names are passed" do bundle "gem foo bar baz" - expect(last_command.bundler_err).to eq(<<-E.strip) + expect(err).to eq(<<-E.strip) ERROR: "bundle gem" was called with arguments ["foo", "bar", "baz"] Usage: "bundle gem NAME [OPTIONS]" E @@ -876,7 +876,7 @@ Usage: "bundle gem NAME [OPTIONS]" FileUtils.touch("conflict-foobar") end bundle "gem conflict-foobar" - expect(last_command.bundler_err).to include("Errno::ENOTDIR") + expect(err).to include("Errno::ENOTDIR") expect(exitstatus).to eql(32) if exitstatus end end diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb index 46c208db6c..d78ee26c1f 100644 --- a/spec/commands/update_spec.rb +++ b/spec/commands/update_spec.rb @@ -565,13 +565,13 @@ RSpec.describe "bundle update when a gem depends on a newer version of bundler" it "should explain that bundler conflicted", :bundler => "< 3" do bundle "update", :all => true expect(last_command.stdboth).not_to match(/in snapshot/i) - expect(last_command.bundler_err).to match(/current Bundler version/i). + expect(err).to match(/current Bundler version/i). and match(/perhaps you need to update bundler/i) end it "should warn that the newer version of Bundler would conflict", :bundler => "3" do bundle! "update", :all => true - expect(last_command.bundler_err).to include("rails (3.0.1) has dependency bundler"). + 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" end @@ -947,7 +947,7 @@ RSpec.describe "bundle update conservative" do it "raises if too many flags are provided" do bundle "update --patch --minor", :all => true - expect(last_command.bundler_err).to eq "Provide only one of the following options: minor, patch" + expect(err).to eq "Provide only one of the following options: minor, patch" end end end |