diff options
| author | Cody Cutrer <cody@instructure.com> | 2023-10-09 11:24:32 -0600 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-03-25 14:25:46 +0000 |
| commit | 552647175e8319aa7cc117d418f35ed761fdb822 (patch) | |
| tree | 68f8471973cd7c55e83eb42e64346f6a8cf2b132 /spec | |
| parent | 65264b0dfb73a4162b638fa2c9cc0e99c66360e2 (diff) | |
[rubygems/rubygems] Improve validation of `bundle plugin install` options
Ensure only one source type is specified, and ensure options that
are only relevant to git sources are only specified with git.
https://github.com/rubygems/rubygems/commit/58b043215e
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/bundler/plugins/install_spec.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/bundler/plugins/install_spec.rb b/spec/bundler/plugins/install_spec.rb index d4776bbed7..86eb4e584c 100644 --- a/spec/bundler/plugins/install_spec.rb +++ b/spec/bundler/plugins/install_spec.rb @@ -92,16 +92,18 @@ RSpec.describe "bundler plugin install" do expect(out).to include("Using foo 1.1") end - it "installs when --branch specified" do - bundle "plugin install foo --branch main --source #{file_uri_for(gem_repo2)}" + it "raises an error when when --branch specified" do + bundle "plugin install foo --branch main --source #{file_uri_for(gem_repo2)}", raise_on_error: false - expect(out).to include("Installed plugin foo") + expect(out).not_to include("Installed plugin foo") + + expect(err).to include("--branch can only be used with git sources") end - it "installs when --ref specified" do - bundle "plugin install foo --ref v1.2.3 --source #{file_uri_for(gem_repo2)}" + it "raises an error when --ref specified" do + bundle "plugin install foo --ref v1.2.3 --source #{file_uri_for(gem_repo2)}", raise_on_error: false - expect(out).to include("Installed plugin foo") + expect(err).to include("--ref can only be used with git sources") end it "raises error when both --branch and --ref options are specified" do |
