summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-05-13 14:47:59 -0700
committerSerdar Sutay <serdar@opscode.com>2014-05-13 14:47:59 -0700
commitfe7e7a481baed7366f18a81103bb7a95cf5e2b2b (patch)
treeec68cf1065d2981f21984ed1d59b1cafb3af2449 /spec
parent59d13c943af14bb337589904e4b27a6460322a0a (diff)
parente30a3b6a9e4931201aab59f61ab27e60c7446b5c (diff)
downloadmixlib-shellout-fe7e7a481baed7366f18a81103bb7a95cf5e2b2b.tar.gz
Merge pull request #26 from akshaykarle/master
[#MIXLIB-19] Copy stderr to live_stream along with stdout of the subprocess
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout_spec.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb
index ac5b19d..277393b 100644
--- a/spec/mixlib/shellout_spec.rb
+++ b/spec/mixlib/shellout_spec.rb
@@ -449,12 +449,17 @@ describe Mixlib::ShellOut do
context "with a live stream" do
let(:stream) { StringIO.new }
- let(:ruby_code) { 'puts "hello"' }
+ let(:ruby_code) { '$stdout.puts "hello"; $stderr.puts "world"' }
let(:options) { { :live_stream => stream } }
it "should copy the child's stdout to the live stream" do
shell_cmd.run_command
- stream.string.should eql("hello#{LINE_ENDING}")
+ stream.string.should include("hello#{LINE_ENDING}")
+ end
+
+ it "should copy the child's stderr to the live stream" do
+ shell_cmd.run_command
+ stream.string.should include("world#{LINE_ENDING}")
end
end