From ff73899d27ce0d2aa875aa24e8e53f1ce6429dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 30 Jan 2018 18:24:58 -0300 Subject: Remove unnecessary assertion exclusion I think this was a bad fix and it's no longer necessary. --- spec/commands/exec_spec.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index 492907743a..acf12ced79 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -843,10 +843,7 @@ __FILE__: #{path.to_s.inspect} expect(bundle!("exec #{file}", :artifice => nil)).to eq(expected) expect(bundle!("exec bundle exec #{file}", :artifice => nil)).to eq(expected) expect(bundle!("exec ruby #{file}", :artifice => nil)).to eq(expected) - # Ignore expectation for default bundler gem conflict. - unless ENV["BUNDLER_SPEC_SUB_VERSION"] - expect(run!(file.read, :artifice => nil)).to eq(expected) - end + expect(run!(file.read, :artifice => nil)).to eq(expected) end # sanity check that we get the newer, custom version without bundler -- cgit v1.2.1 From 371ff5114f275abceedf7d03f8f2dac869a296e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 24 Sep 2018 17:11:32 -0300 Subject: Improve redownload specs So they are run on bundler 1.x too. --- spec/install/redownload_spec.rb | 16 +++++++++++++--- spec/update/redownload_spec.rb | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/spec/install/redownload_spec.rb b/spec/install/redownload_spec.rb index 1225c839c4..232c0f9e2c 100644 --- a/spec/install/redownload_spec.rb +++ b/spec/install/redownload_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle install", :bundler => "2" do +RSpec.describe "bundle install" do before :each do gemfile <<-G source "file://#{gem_repo1}" @@ -61,15 +61,25 @@ RSpec.describe "bundle install", :bundler => "2" do let(:flag) { "force" } end - it "shows a deprecation when single flag passed" do + it "shows a deprecation when single flag passed", :bundler => 2 do bundle! "install --force" expect(out).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" end - it "shows a deprecation when multiple flags passed" do + it "shows a deprecation when multiple flags passed", :bundler => 2 do bundle! "install --no-color --force" expect(out).to include "[DEPRECATED FOR 2.0] 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`" + 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`" + end end describe "with --redownload" do diff --git a/spec/update/redownload_spec.rb b/spec/update/redownload_spec.rb index 8c716664e2..5a739c51b3 100644 --- a/spec/update/redownload_spec.rb +++ b/spec/update/redownload_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle update", :bundler => "2" do +RSpec.describe "bundle update" do before :each do install_gemfile <<-G source "file://#{gem_repo1}" @@ -9,15 +9,25 @@ RSpec.describe "bundle update", :bundler => "2" do end describe "with --force" do - it "shows a deprecation when single flag passed" do + it "shows a deprecation when single flag passed", :bundler => 2 do bundle! "update rack --force" expect(out).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`" end - it "shows a deprecation when multiple flags passed" do + it "shows a deprecation when multiple flags passed", :bundler => 2 do bundle! "update rack --no-color --force" expect(out).to include "[DEPRECATED FOR 2.0] 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`" + 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`" + end end describe "with --redownload" do -- cgit v1.2.1