diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2021-08-19 11:57:16 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-08-31 19:06:14 +0900 |
commit | f934096638ec5850b65e45dc7230900107441288 (patch) | |
tree | e91661feb40a38070e0f4296229fa37db22e0aa9 /spec/bundler/plugins | |
parent | 3a9dd795a70705d130fb856db148b068d26821c1 (diff) |
[rubygems/rubygems] Make plugin installation idempotent
The error had not be caught be specs because `bundle install` was
returning a zero exit code when plugin installation errors happened. So
I fixed that issue too.
https://github.com/rubygems/rubygems/commit/90cde87856
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4789
Diffstat (limited to 'spec/bundler/plugins')
-rw-r--r-- | spec/bundler/plugins/command_spec.rb | 6 | ||||
-rw-r--r-- | spec/bundler/plugins/install_spec.rb | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/spec/bundler/plugins/command_spec.rb b/spec/bundler/plugins/command_spec.rb index 4567a39081..3a7adf4b48 100644 --- a/spec/bundler/plugins/command_spec.rb +++ b/spec/bundler/plugins/command_spec.rb @@ -69,12 +69,10 @@ RSpec.describe "command plugins" do end end - bundle "plugin install copycat --source #{file_uri_for(gem_repo2)}" + bundle "plugin install copycat --source #{file_uri_for(gem_repo2)}", :raise_on_error => false expect(out).not_to include("Installed plugin copycat") - expect(err).to include("Failed to install the following plugins: `copycat`") - - expect(err).to include("Command(s) `mahcommand` declared by copycat are already registered.") + expect(err).to include("Failed to install plugin `copycat`, due to Bundler::Plugin::Index::CommandConflict (Command(s) `mahcommand` declared by copycat are already registered.)") end end diff --git a/spec/bundler/plugins/install_spec.rb b/spec/bundler/plugins/install_spec.rb index c719e8533e..b382d3ccd2 100644 --- a/spec/bundler/plugins/install_spec.rb +++ b/spec/bundler/plugins/install_spec.rb @@ -109,9 +109,9 @@ RSpec.describe "bundler plugin install" do build_gem "charlie" end - bundle "plugin install charlie --source #{file_uri_for(gem_repo2)}" + bundle "plugin install charlie --source #{file_uri_for(gem_repo2)}", :raise_on_error => false - expect(err).to include("Failed to install the following plugins: `charlie`. The underlying error was: plugins.rb was not found") + expect(err).to include("Failed to install plugin `charlie`, due to Bundler::Plugin::MalformattedPlugin (plugins.rb was not found in the plugin.)") expect(global_plugin_gem("charlie-1.0")).not_to be_directory @@ -128,7 +128,7 @@ RSpec.describe "bundler plugin install" do end end - bundle "plugin install chaplin --source #{file_uri_for(gem_repo2)}" + bundle "plugin install chaplin --source #{file_uri_for(gem_repo2)}", :raise_on_error => false expect(global_plugin_gem("chaplin-1.0")).not_to be_directory |