diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/commands/show_spec.rb | 8 | ||||
-rw-r--r-- | spec/install/gemfile/sources_spec.rb | 3 | ||||
-rw-r--r-- | spec/install/redownload_spec.rb | 12 | ||||
-rw-r--r-- | spec/other/major_deprecation_spec.rb | 18 | ||||
-rw-r--r-- | spec/runtime/with_unbundled_env_spec.rb | 16 | ||||
-rw-r--r-- | spec/support/matchers.rb | 2 | ||||
-rw-r--r-- | spec/update/redownload_spec.rb | 12 |
7 files changed, 25 insertions, 46 deletions
diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 08b106d0a0..6692fb0cfb 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -32,7 +32,7 @@ RSpec.describe "bundle show" do it "prints deprecation", :bundler => "2" do bundle "show rails" - expect(err).to eq("[DEPRECATED FOR 2.0] use `bundle info rails` instead of `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 @@ -42,7 +42,7 @@ RSpec.describe "bundle show" do it "prints deprecation when called with a gem and the --paths option", :bundler => "2" do bundle "show rails --paths" - expect(err).to eq("[DEPRECATED FOR 2.0] use `bundle info rails --path` instead of `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 @@ -61,7 +61,7 @@ RSpec.describe "bundle show" do it "prints deprecation when called with bundler", :bundler => "2" do bundle "show bundler" - expect(err).to eq("[DEPRECATED FOR 2.0] use `bundle info bundler` instead of `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" @@ -82,7 +82,7 @@ RSpec.describe "bundle show" do it "prints a deprecation when called with the --paths option", :bundler => 2 do bundle "show --paths" - expect(err).to eq("[DEPRECATED FOR 2.0] use `bundle list` instead of `bundle show --paths`") + expect(err).to eq("[DEPRECATED] use `bundle list` instead of `bundle show --paths`") end it "prints summary of gems" do diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb index 0af77cf862..c8f46e48c8 100644 --- a/spec/install/gemfile/sources_spec.rb +++ b/spec/install/gemfile/sources_spec.rb @@ -25,7 +25,6 @@ RSpec.describe "bundle install with gems on multiple sources" do gem "rack-obama" gem "rack" G - bundle "config set major_deprecations true" end it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first", :bundler => "< 2" do @@ -55,7 +54,6 @@ RSpec.describe "bundle install with gems on multiple sources" do gem "rack-obama" gem "rack", "1.0.0" # force it to install the working version in repo1 G - bundle "config set major_deprecations true" end it "warns about ambiguous gems, but installs anyway", :bundler => "< 2" do @@ -249,7 +247,6 @@ RSpec.describe "bundle install with gems on multiple sources" do end it "installs from the other source and warns about ambiguous gems", :bundler => "< 2" do - bundle "config set major_deprecations true" bundle :install expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.") expect(out).to include("Warning: the gem 'rack' was found in multiple sources.") diff --git a/spec/install/redownload_spec.rb b/spec/install/redownload_spec.rb index 141a2e80d5..de726c4562 100644 --- a/spec/install/redownload_spec.rb +++ b/spec/install/redownload_spec.rb @@ -63,22 +63,22 @@ RSpec.describe "bundle install" do it "shows a deprecation when single flag passed", :bundler => 2 do bundle! "install --force" - expect(err).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(err).to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end it "shows a deprecation when multiple flags passed", :bundler => 2 do bundle! "install --no-color --force" - expect(err).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(err).to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end it "does not show a deprecation when single flag passed", :bundler => "< 2" do bundle! "install --force" - expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(out).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end it "does not show a deprecation when multiple flags passed", :bundler => "< 2" do bundle! "install --no-color --force" - expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(out).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end end @@ -89,12 +89,12 @@ RSpec.describe "bundle install" do it "does not show a deprecation when single flag passed" do bundle! "install --redownload" - expect(err).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(err).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end it "does not show a deprecation when single multiple flags passed" do bundle! "install --no-color --redownload" - expect(err).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(err).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end end end diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb index 800c7b4b88..6e278dc45d 100644 --- a/spec/other/major_deprecation_spec.rb +++ b/spec/other/major_deprecation_spec.rb @@ -4,25 +4,7 @@ RSpec.describe "major deprecations", :bundler => "< 2" do let(:warnings) { last_command.bundler_err } # change to err in 2.0 let(:warnings_without_version_messages) { warnings.gsub(/#{Spec::Matchers::MAJOR_DEPRECATION}Bundler will only support ruby(gems)? >= .*/, "") } - context "in a .99 version" do - before do - simulate_bundler_version "1.99.1" - bundle "config unset major_deprecations" - end - - it "prints major deprecations without being configured" do - ruby <<-R - require "bundler" - Bundler::SharedHelpers.major_deprecation(Bundler::VERSION) - R - - expect(warnings).to have_major_deprecation("1.99.1") - end - end - before do - bundle "config set major_deprecations true" - create_file "gems.rb", <<-G source "file:#{gem_repo1}" ruby #{RUBY_VERSION.dump} diff --git a/spec/runtime/with_unbundled_env_spec.rb b/spec/runtime/with_unbundled_env_spec.rb index 5ddcc24ed4..605bed8254 100644 --- a/spec/runtime/with_unbundled_env_spec.rb +++ b/spec/runtime/with_unbundled_env_spec.rb @@ -106,8 +106,8 @@ RSpec.describe "Bundler.with_env helpers" do it "prints a deprecation", :bundler => 2 do code = "Bundler.clean_env" bundle_exec_ruby! code.dump - expect(last_command.stdboth).to include( - "[DEPRECATED FOR 2.0] `Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \ + expect(err).to include( + "[DEPRECATED] `Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \ "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`" ) end @@ -115,8 +115,8 @@ RSpec.describe "Bundler.with_env helpers" do it "does not print a deprecation", :bundler => "< 2" do code = "Bundler.clean_env" bundle_exec_ruby! code.dump - expect(last_command.stdboth).not_to include( - "[DEPRECATED FOR 2.0] `Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \ + expect(out).not_to include( + "[DEPRECATED] `Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \ "If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`" ) end @@ -156,8 +156,8 @@ RSpec.describe "Bundler.with_env helpers" do it "prints a deprecation", :bundler => 2 do code = "Bundler.with_clean_env {}" bundle_exec_ruby! code.dump - expect(last_command.stdboth).to include( - "[DEPRECATED FOR 2.0] `Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \ + expect(err).to include( + "[DEPRECATED] `Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \ "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`" ) end @@ -165,8 +165,8 @@ RSpec.describe "Bundler.with_env helpers" do it "does not print a deprecation", :bundler => "< 2" do code = "Bundler.with_clean_env {}" bundle_exec_ruby! code.dump - expect(last_command.stdboth).not_to include( - "[DEPRECATED FOR 2.0] `Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \ + expect(out).not_to include( + "[DEPRECATED] `Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \ "If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`" ) end diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index 18ccf38fb1..c39f2881a6 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -60,7 +60,7 @@ module Spec end end - MAJOR_DEPRECATION = /^\[DEPRECATED FOR 2\.0\]\s*/ + MAJOR_DEPRECATION = /^\[DEPRECATED\]\s*/ RSpec::Matchers.define :eq_err do |expected| diffable diff --git a/spec/update/redownload_spec.rb b/spec/update/redownload_spec.rb index 2653d5d1a3..b70c009248 100644 --- a/spec/update/redownload_spec.rb +++ b/spec/update/redownload_spec.rb @@ -11,34 +11,34 @@ RSpec.describe "bundle update" do describe "with --force" do it "shows a deprecation when single flag passed", :bundler => 2 do bundle! "update rack --force" - expect(err).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(err).to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end it "shows a deprecation when multiple flags passed", :bundler => 2 do bundle! "update rack --no-color --force" - expect(err).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(err).to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end it "does not show a deprecation when single flag passed", :bundler => "< 2" do bundle! "update rack --force" - expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(out).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end it "does not show a deprecation when multiple flags passed", :bundler => "< 2" do bundle! "update rack --no-color --force" - expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(out).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end end describe "with --redownload" do it "does not show a deprecation when single flag passed" do bundle! "update rack --redownload" - expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(err).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end it "does not show a deprecation when single multiple flags passed" do bundle! "update rack --no-color --redownload" - expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" + expect(err).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`" end end end |