diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/cli_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/ui/shell_spec.rb | 24 | ||||
-rw-r--r-- | spec/support/command_execution.rb | 6 | ||||
-rw-r--r-- | spec/support/helpers.rb | 2 |
4 files changed, 9 insertions, 27 deletions
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb index 6a505358d1..649e304de2 100644 --- a/spec/bundler/cli_spec.rb +++ b/spec/bundler/cli_spec.rb @@ -125,7 +125,7 @@ RSpec.describe "bundle executable" do let(:latest_version) { "222.0" } it "prints the version warning" do bundle "fail" - expect(last_command.stdout).to start_with(<<-EOS.strip) + expect(last_command.stderr).to start_with(<<-EOS.strip) The latest bundler is #{latest_version}, but you are currently running #{bundler_version}. To install the latest version, run `gem install bundler` EOS @@ -150,7 +150,7 @@ To install the latest version, run `gem install bundler` let(:latest_version) { "222.0.0.pre.4" } it "prints the version warning" do bundle "fail" - expect(last_command.stdout).to start_with(<<-EOS.strip) + expect(last_command.stderr).to start_with(<<-EOS.strip) The latest bundler is #{latest_version}, but you are currently running #{bundler_version}. To install the latest version, run `gem install bundler --pre` EOS diff --git a/spec/bundler/ui/shell_spec.rb b/spec/bundler/ui/shell_spec.rb index 23a7670dd1..632477096e 100644 --- a/spec/bundler/ui/shell_spec.rb +++ b/spec/bundler/ui/shell_spec.rb @@ -24,13 +24,6 @@ RSpec.describe Bundler::UI::Shell do it "prints to stderr" do expect { subject.warn("warning") }.to output("warning\n").to_stderr end - - context "when stderr flag is enabled" do - before { Bundler.settings.temporary(:error_on_stderr => true) } - it "prints to stderr" do - expect { subject.warn("warning!") }.to output("warning!\n").to_stderr - end - end end describe "#debug" do @@ -46,19 +39,12 @@ RSpec.describe Bundler::UI::Shell do expect { subject.error("error!!!") }.to output("error!!!\n").to_stderr end - context "when stderr flag is enabled" do - before { Bundler.settings.temporary(:error_on_stderr => true) } - it "prints to stderr" do - expect { subject.error("error!!!") }.to output("error!!!\n").to_stderr - end - - context "when stderr is closed" do - it "doesn't report anything" do - output = capture(:stderr, :closed => true) do - subject.error("Something went wrong") - end - expect(output).to_not eq("Something went wrong\n") + context "when stderr is closed" do + it "doesn't report anything" do + output = capture(:stderr, :closed => true) do + subject.error("Something went wrong") end + expect(output).to_not eq("Something went wrong\n") end end end diff --git a/spec/support/command_execution.rb b/spec/support/command_execution.rb index 556285ac52..f3dd627ed2 100644 --- a/spec/support/command_execution.rb +++ b/spec/support/command_execution.rb @@ -28,11 +28,7 @@ module Spec end def bundler_err - if Bundler::VERSION.start_with?("1.") - stdout - else - stderr - end + stderr end def to_s_verbose diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 6470b57fb8..53459669e6 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -45,7 +45,7 @@ module Spec end def err - Bundler.feature_flag.error_on_stderr? ? last_command.stderr : last_command.stdout + last_command.stderr end MAJOR_DEPRECATION = /^\[DEPRECATED\]\s*/.freeze |