summaryrefslogtreecommitdiff
path: root/spec/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-07-25 13:03:09 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-07-27 09:25:56 +0900
commit9ac89fe35e0ddbf28be436c275e1de5287e35c23 (patch)
treefc44743c51b27d712cc17e4b3d8678b89fff8b42 /spec/bundler
parent24aca87def4944ebb6bf9e7173dd41920dc10e7a (diff)
[rubygems/rubygems] The `--quiet` should still display warnings
The is the previous intentional behaviour until https://github.com/rubygems/bundler/commit/ca0676cb1c638e0b9747ea8c18f28adf82cc01de. In my opinion, that previous behaviour was better and should be restored, because we want our users to always see warnings and fix them. And the original issue that motivated the change is fixable by other means, namely through `BUNDLE_SILENCE_ROOT_WARNING`, or through `BUNDLE_SILENCE_DEPRECATIONS` in general. Finally, the --quiet option is still documented as "only print errors and warnings". So this PR essentially reverts https://github.com/rubygems/bundler/commit/ca0676cb1c638e0b9747ea8c18f28adf82cc01de for the above reasons. https://github.com/rubygems/rubygems/commit/35f2254dfc
Diffstat (limited to 'spec/bundler')
-rw-r--r--spec/bundler/commands/install_spec.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb
index 478ee9c38a..789fd9b5c0 100644
--- a/spec/bundler/commands/install_spec.rb
+++ b/spec/bundler/commands/install_spec.rb
@@ -585,7 +585,20 @@ RSpec.describe "bundle install with gem sources" do
end
describe "when requesting a quiet install via --quiet" do
- it "should be quiet" do
+ it "should be quiet if there are no warnings" do
+ bundle "config set force_ruby_platform true"
+
+ gemfile <<-G
+ source "#{file_uri_for(gem_repo1)}"
+ gem 'rack'
+ G
+
+ bundle :install, :quiet => true
+ expect(out).to be_empty
+ expect(err).to be_empty
+ end
+
+ it "should still display warnings and errors" do
bundle "config set force_ruby_platform true"
create_file("install_with_warning.rb", <<~RUBY)
@@ -611,8 +624,9 @@ RSpec.describe "bundle install with gem sources" do
G
bundle :install, :quiet => true, :raise_on_error => false, :env => { "RUBYOPT" => "-r#{bundled_app("install_with_warning.rb")}" }
+ expect(out).to be_empty
expect(err).to include("Could not find gem 'non-existing-gem'")
- expect(err).not_to include("BOOOOO")
+ expect(err).to include("BOOOOO")
end
end