diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-27 23:28:21 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-28 13:19:42 +0200 |
commit | 8452e246540fed81ab24c59f07edd6876a6d330b (patch) | |
tree | 65ee3090f767e169be92274c0e8ca579ec46ffcb | |
parent | 9f90dca2a05d721ba48c7f2aa8e08c54390e2a16 (diff) | |
download | bundler-8452e246540fed81ab24c59f07edd6876a6d330b.tar.gz |
Unify `bundle show` deprecation specs
-rw-r--r-- | spec/commands/show_spec.rb | 20 | ||||
-rw-r--r-- | spec/other/major_deprecation_spec.rb | 24 |
2 files changed, 24 insertions, 20 deletions
diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 6e1986e35f..3ae82f6fb3 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -30,21 +30,11 @@ RSpec.describe "bundle show", :bundler => "< 3" do expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end - it "prints deprecation" do - bundle "show rails" - expect(err).to eq("[DEPRECATED] use `bundle info rails` instead of `bundle show rails`") - end - it "prints path if gem exists in bundle (with --paths option)" do bundle "show rails --paths" expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end - it "prints deprecation when called with a gem and the --paths option" do - bundle "show rails --paths" - expect(err).to eq("[DEPRECATED] use `bundle info rails --path` instead of `bundle show rails --paths`") - end - it "warns if path no longer exists on disk" do FileUtils.rm_rf(default_bundle_path("gems", "rails-2.3.2")) @@ -59,10 +49,6 @@ RSpec.describe "bundle show", :bundler => "< 3" do expect(out).to eq(root.to_s) end - it "prints deprecation when called with bundler" do - bundle "show bundler" - expect(err).to eq("[DEPRECATED] use `bundle info bundler` instead of `bundle show bundler`") - end it "complains if gem not in bundle" do bundle "show missing" expect(err).to match(/could not find gem 'missing'/i) @@ -79,12 +65,6 @@ RSpec.describe "bundle show", :bundler => "< 3" do expect(gem_list).to eq(gem_list.sort) end - it "prints a deprecation when called with the --paths option" do - bundle "show --paths" - - expect(err).to eq("[DEPRECATED] use `bundle list` instead of `bundle show --paths`") - end - it "prints summary of gems" do bundle "show --verbose" diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index c23f78ff7a..8ee48f55d5 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -483,6 +483,30 @@ The :gist git source is deprecated, and will be removed in the future. Add this pending "fails with a helpful message", :bundler => "3" end + + context "with the --paths option" do + before do + bundle "show --paths" + end + + it "prints a deprecation warning recommending `bundle list`", :bundler => "2" do + expect(deprecations).to include("use `bundle list` instead of `bundle show --paths`") + end + + pending "fails with a helpful message", :bundler => "3" + end + + context "with a gem argument and the --paths option" do + before do + bundle "show rack --paths" + end + + it "prints deprecation warning recommending `bundle info`", :bundler => "2" do + expect(deprecations).to include("use `bundle info rack --path` instead of `bundle show rack --paths`") + end + + pending "fails with a helpful message", :bundler => "3" + end end context "bundle console" do |