summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2018-09-18 20:27:53 -0300
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2018-09-18 21:40:54 -0300
commitbae91432ee8dc278ec7bb8d0a292391708235715 (patch)
treef0022ffd67f90fba021aaa2fe0d07bb9d36adee5
parent2d2059a87e1e1bd9a1fc986c7656508af51b6207 (diff)
downloadbundler-bae91432ee8dc278ec7bb8d0a292391708235715.tar.gz
Fix issue with initial implementation
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--spec/install/redownload_spec.rb18
2 files changed, 15 insertions, 5 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 73f4e1bf9d..5679b65553 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -229,7 +229,7 @@ module Bundler
"Include gems that are part of the specified named group."
map "i" => "install"
def install
- SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV[1] == "--force"
+ SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
require "bundler/cli/install"
Bundler.settings.temporary(:no_install => false) do
Install.new(options.dup).run
diff --git a/spec/install/redownload_spec.rb b/spec/install/redownload_spec.rb
index d6fcc9c2b8..a3fdc07475 100644
--- a/spec/install/redownload_spec.rb
+++ b/spec/install/redownload_spec.rb
@@ -61,8 +61,13 @@ RSpec.describe "bundle install" do
let(:flag) { "force" }
end
- it "shows a deprecation" do
- bundle! :install, :force => true
+ it "shows a deprecation when single flag passed" 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
+ bundle! "install --no-color --force"
expect(out).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
end
end
@@ -72,8 +77,13 @@ RSpec.describe "bundle install" do
let(:flag) { "redownload" }
end
- it "does not show a deprecation" do
- bundle! :install, :redownload => true
+ it "does not show a deprecation when single flag passed" do
+ bundle! "install --redownload"
+ 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 single multiple flags passed" do
+ bundle! "install --no-color --redownload"
expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
end
end