summaryrefslogtreecommitdiff
path: root/spec/commands/exec_spec.rb
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-04-14 12:04:15 +0000
committerBundlerbot <bot@bundler.io>2019-04-14 12:04:15 +0000
commit9424cedb913b738bbd733e30c772524ea054f5fe (patch)
tree8bd3e0dbedcacd4e05d1126c819807ece21dbd3e /spec/commands/exec_spec.rb
parenta53709556b95a914e874b22ed2116a46b0528852 (diff)
parentc494e1261268a5249b6406fe35709016f7c4c3ac (diff)
downloadbundler-9424cedb913b738bbd733e30c772524ea054f5fe.tar.gz
Merge #6730
6730: Print errors to stderr by default, and remove configuration option r=greysteil a=greysteil ### What was the end-user problem that led to this PR? The problem was #6729 - Bundler unexpectedly outputs error and warning messages to STDOUT. ### What was your diagnosis of the problem? My diagnosis was that whilst very minorly breaking, this is essentially a bug fix, and should be considered for inclusion for Bundler 2.0 even if very few other breaking changes are. ### What is your fix for the problem, implemented in this PR? My fix was so switch output for warning and error messages to STDERR, and remove the configuration option (as is redundant once the setup is flipped - anyone wanting to redirect those message to STDOUT could do so in their shell). ### Why did you choose this fix out of the possible options? I chose this fix because I think the new behaviour is what everyone would expect, and we should get it out from behind its feature switch sooner rather than later. Alternatively, we might want to keep the Bundler 2.0 release "purer" by only dropping Ruby versions in it - that's totally fine too, but I figured we should have the code to discus #6729, rather than doing it in abstract. Co-authored-by: Grey Baker <greysteil@gmail.com> Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Diffstat (limited to 'spec/commands/exec_spec.rb')
-rw-r--r--spec/commands/exec_spec.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index a95383ee97..655313534d 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -88,14 +88,14 @@ RSpec.describe "bundle exec" do
sys_exec "#{Gem.ruby} #{command.path}"
expect(out).to eq("")
- expect(last_command.stderr).to be_empty
+ expect(err).to be_empty
end
it "accepts --keep-file-descriptors" do
install_gemfile ""
bundle "exec --keep-file-descriptors echo foobar"
- expect(last_command.stderr).to be_empty
+ expect(err).to be_empty
end
it "can run a command named --verbose" do
@@ -156,7 +156,7 @@ RSpec.describe "bundle exec" do
bundle! "exec irb --version"
expect(out).to include(default_irb_version)
- expect(last_command.stderr).to be_empty
+ expect(err).to be_empty
end
end
@@ -182,7 +182,7 @@ RSpec.describe "bundle exec" do
bundle! "exec irb --version"
expect(out).to include(specified_irb_version)
- expect(last_command.stderr).to be_empty
+ expect(err).to be_empty
end
end
@@ -212,7 +212,7 @@ RSpec.describe "bundle exec" do
it "uses resolved version" do
expect(out).to include(indirect_irb_version)
- expect(last_command.stderr).to be_empty
+ expect(err).to be_empty
end
end
end
@@ -334,7 +334,7 @@ RSpec.describe "bundle exec" do
[true, false].each do |l|
bundle! "config set disable_exec_load #{l}"
bundle "exec rackup"
- expect(last_command.stderr).to include "can't find executable rackup for gem rack. rack is not currently included in the bundle, perhaps you meant to add it to your Gemfile?"
+ expect(err).to include "can't find executable rackup for gem rack. rack is not currently included in the bundle, perhaps you meant to add it to your Gemfile?"
end
end
@@ -552,8 +552,8 @@ RSpec.describe "bundle exec" do
bundle "exec irb"
- expect(last_command.stderr).to match("The gemspec at #{lib_path("foo-1.0").join("foo.gemspec")} is not valid")
- expect(last_command.stderr).to match('"TODO" is not a summary')
+ expect(err).to match("The gemspec at #{lib_path("foo-1.0").join("foo.gemspec")} is not valid")
+ expect(err).to match('"TODO" is not a summary')
end
end
@@ -614,8 +614,8 @@ RSpec.describe "bundle exec" do
it "like a normally executed executable" do
subject
expect(exitstatus).to eq(exit_code) if exitstatus
- expect(last_command.stderr).to eq(expected_err)
- expect(last_command.stdout).to eq(expected)
+ expect(err).to eq(expected_err)
+ expect(out).to eq(expected)
end
end
@@ -886,7 +886,7 @@ __FILE__: #{path.to_s.inspect}
# sanity check that we get the newer, custom version without bundler
sys_exec("#{Gem.ruby} #{file}")
- expect(last_command.stderr).to include("custom openssl should not be loaded")
+ expect(err).to include("custom openssl should not be loaded")
end
end
end