diff options
author | Cody Cutrer <cody@instructure.com> | 2023-09-14 11:58:11 -0600 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-10-31 13:53:05 +0000 |
commit | b5d54fc15955c636cc37b76931a6e3ce1d209f70 (patch) | |
tree | 7da4e02c511b321b92d235371e6c8f24a7b63fcb /spec | |
parent | b06b69e6dc004fd275984bb42f05caa86e487566 (diff) |
[rubygems/rubygems] Only remove bundler plugin gem when it's inside the cache
https://github.com/rubygems/rubygems/commit/8d51390ca4
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/plugins/uninstall_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/bundler/plugins/uninstall_spec.rb b/spec/bundler/plugins/uninstall_spec.rb index 8180241911..555c6a7002 100644 --- a/spec/bundler/plugins/uninstall_spec.rb +++ b/spec/bundler/plugins/uninstall_spec.rb @@ -30,6 +30,31 @@ RSpec.describe "bundler plugin uninstall" do plugin_should_not_be_installed("foo") end + it "doesn't wipe out path plugins" do + build_lib "path_plugin" do |s| + s.write "plugins.rb" + end + path = lib_path("path_plugin-1.0") + expect(path).to be_a_directory + + allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) + + install_gemfile <<-G + source '#{file_uri_for(gem_repo2)}' + plugin 'path_plugin', :path => "#{path}" + gem 'rack', '1.0.0' + G + + plugin_should_be_installed("path_plugin") + expect(Bundler::Plugin.index.plugin_path("path_plugin")).to eq path + + bundle "plugin uninstall path_plugin" + expect(out).to include("Uninstalled plugin path_plugin") + plugin_should_not_be_installed("path_plugin") + # the actual gem still exists though + expect(path).to be_a_directory + end + describe "with --all" do it "uninstalls all installed plugins" do bundle "plugin install foo kung-foo --source #{file_uri_for(gem_repo2)}" |