diff options
Diffstat (limited to 'spec/bundler/ui/shell_spec.rb')
-rw-r--r-- | spec/bundler/ui/shell_spec.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/bundler/ui/shell_spec.rb b/spec/bundler/ui/shell_spec.rb index 6585ab1da8..9a47a3572f 100644 --- a/spec/bundler/ui/shell_spec.rb +++ b/spec/bundler/ui/shell_spec.rb @@ -21,9 +21,20 @@ RSpec.describe Bundler::UI::Shell do describe "#warn" do before { subject.level = "warn" } - it "prints to stdout" do + it "prints to stdout", :bundler => "< 2" do expect { subject.warn("warning") }.to output("warning\n").to_stdout end + + it "prints to stderr", :bundler => "2" 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 @@ -35,7 +46,7 @@ RSpec.describe Bundler::UI::Shell do describe "#error" do before { subject.level = "error" } - it "prints to stdout", :bundler => "<= 2" do + it "prints to stdout", :bundler => "< 2" do expect { subject.error("error!!!") }.to output("error!!!\n").to_stdout end |