summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorCody Cutrer <cody@instructure.com>2023-10-09 11:38:42 -0600
committergit <svn-admin@ruby-lang.org>2024-03-18 11:42:37 +0000
commitcb029fa4e8d2e8778f7a7b911bc7f0a0bd675524 (patch)
treeb00d2d0d37b3e918a92ade91ba0c9e5d64472a20 /spec
parent8a8df4917488ff1c8034119a94216f1b04ed3bfc (diff)
[rubygems/rubygems] Deprecate `bundle plugin install --local-git=`
It's the exact same implementation as --git https://github.com/rubygems/rubygems/commit/18eb2418c6
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/bundler/plugin/installer_spec.rb6
-rw-r--r--spec/bundler/other/major_deprecation_spec.rb17
-rw-r--r--spec/bundler/plugins/install_spec.rb6
3 files changed, 23 insertions, 6 deletions
diff --git a/spec/bundler/bundler/plugin/installer_spec.rb b/spec/bundler/bundler/plugin/installer_spec.rb
index 2cf69649db..ed40029f5a 100644
--- a/spec/bundler/bundler/plugin/installer_spec.rb
+++ b/spec/bundler/bundler/plugin/installer_spec.rb
@@ -25,10 +25,10 @@ RSpec.describe Bundler::Plugin::Installer do
end
it "returns the installed spec after installing local git plugins" do
- allow(installer).to receive(:install_local_git).
+ allow(installer).to receive(:install_git).
and_return("new-plugin" => spec)
- expect(installer.install(["new-plugin"], local_git: "/phony/path/repo")).
+ expect(installer.install(["new-plugin"], git: "/phony/path/repo")).
to eq("new-plugin" => spec)
end
@@ -80,7 +80,7 @@ RSpec.describe Bundler::Plugin::Installer do
end
let(:result) do
- installer.install(["ga-plugin"], local_git: lib_path("ga-plugin").to_s)
+ installer.install(["ga-plugin"], git: lib_path("ga-plugin").to_s)
end
it "returns the installed spec after installing" do
diff --git a/spec/bundler/other/major_deprecation_spec.rb b/spec/bundler/other/major_deprecation_spec.rb
index 7dad0e8c3d..939b68a0bb 100644
--- a/spec/bundler/other/major_deprecation_spec.rb
+++ b/spec/bundler/other/major_deprecation_spec.rb
@@ -601,6 +601,23 @@ RSpec.describe "major deprecations" do
pending "fails with a helpful message", bundler: "3"
end
+ context "bundle plugin install --local_git" do
+ before do
+ build_git "foo" do |s|
+ s.write "plugins.rb"
+ end
+ end
+
+ it "prints a deprecation warning", bundler: "< 3" do
+ bundle "plugin install foo --local_git #{lib_path("foo-1.0")}"
+
+ expect(out).to include("Installed plugin foo")
+ expect(deprecations).to include "--local_git is deprecated, use --git"
+ end
+
+ pending "fails with a helpful message", bundler: "3"
+ end
+
describe "deprecating rubocop", :readline do
context "bundle gem --rubocop" do
before do
diff --git a/spec/bundler/plugins/install_spec.rb b/spec/bundler/plugins/install_spec.rb
index ca8e2d2e51..d4776bbed7 100644
--- a/spec/bundler/plugins/install_spec.rb
+++ b/spec/bundler/plugins/install_spec.rb
@@ -196,14 +196,14 @@ RSpec.describe "bundler plugin install" do
s.write "plugins.rb"
end
- bundle "plugin install foo --local_git #{lib_path("foo-1.0")}"
+ bundle "plugin install foo --git #{lib_path("foo-1.0")}"
expect(out).to include("Installed plugin foo")
plugin_should_be_installed("foo")
end
- it "raises an error when both git and local git sources are specified" do
- bundle "plugin install foo --local_git /phony/path/project --git git@gitphony.com:/repo/project", raise_on_error: false
+ it "raises an error when both git and local git sources are specified", bundler: "< 3" do
+ bundle "plugin install foo --git /phony/path/project --local_git git@gitphony.com:/repo/project", raise_on_error: false
expect(exitstatus).not_to eq(0)
expect(err).to eq("Remote and local plugin git sources can't be both specified")