diff options
author | Serdar Sutay <serdar@opscode.com> | 2014-05-13 14:47:59 -0700 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2014-05-13 14:47:59 -0700 |
commit | fe7e7a481baed7366f18a81103bb7a95cf5e2b2b (patch) | |
tree | ec68cf1065d2981f21984ed1d59b1cafb3af2449 /spec | |
parent | 59d13c943af14bb337589904e4b27a6460322a0a (diff) | |
parent | e30a3b6a9e4931201aab59f61ab27e60c7446b5c (diff) | |
download | mixlib-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.rb | 9 |
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 |