summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-06-20 18:19:36 +0000
committerSamuel Giddins <segiddins@segiddins.me>2017-07-17 12:02:31 -0500
commit571aa4f790dc8849a377566f553533b4759cd95e (patch)
tree61a1d8b796fbe3cbcb536cd8de5aa92545aec612 /spec
parentd440b9df151149a7bcbcbbf5f4ab7bf5c4ae8ab2 (diff)
downloadbundler-571aa4f790dc8849a377566f553533b4759cd95e.tar.gz
Auto merge of #5791 - bundler:seg-verbose-cli-print-no-defaults, r=colby-swandale
[CLI] Dont print defaults in the command printed with --verbose ### What was the end-user problem that led to this PR? The problem was that running `bundle lock --verbose` would print Running `bundle lock --add-platform --remove-platform --verbose` with bundler 1.15.1 even though the platform flags were never specified. This was surfaced by https://github.com/bundler/bundler/pull/5724, which will be fixed by this PR. ### Was was your diagnosis of the problem? My diagnosis was that default values of options were being printed. ### What is your fix for the problem, implemented in this PR? My fix is to filter out the default values before getting Thor ### Why did you choose this fix out of the possible options? I chose this fix because there is no way, within the `CLI` instance, to tell which flags the user has explicitly given, so I felt that filtering out those options that had default values was the next-best thing. (cherry picked from commit de7d488b833ba30cb6fb7b8a37ebf0367c05c196) # Conflicts: # lib/bundler/cli.rb
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/cli_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index ec1d384851..4963698c8e 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -60,6 +60,11 @@ RSpec.describe "bundle executable" do
bundle! "config", :verbose => true
expect(out).to start_with("Running `bundle config --verbose` with bundler #{Bundler::VERSION}")
end
+
+ it "doesn't print defaults" do
+ install_gemfile! "", :verbose => true
+ expect(out).to start_with("Running `bundle install --no-color --retry 0 --verbose` with bundler #{Bundler::VERSION}")
+ end
end
describe "printing the outdated warning" do