summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHo-Sheng Hsiao <hosheng.hsiao@gmail.com>2012-03-23 16:39:16 -0400
committerHo-Sheng Hsiao <hosheng.hsiao@gmail.com>2012-03-23 16:39:16 -0400
commitfffd9250320566aafd3c5c14af025cc93a4e6f99 (patch)
tree8e261a7ec40362eb90af130a64105b74f490fa7c /spec
parent068864614a7fb98b00fb77b95033b2012f68c6f1 (diff)
downloadmixlib-shellout-fffd9250320566aafd3c5c14af025cc93a4e6f99.tar.gz
[RSPEC] Refactored spec for subprocess that pauses efore writing
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout/shellout_spec.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/mixlib/shellout/shellout_spec.rb b/spec/mixlib/shellout/shellout_spec.rb
index 8b1bdff..5be57b4 100644
--- a/spec/mixlib/shellout/shellout_spec.rb
+++ b/spec/mixlib/shellout/shellout_spec.rb
@@ -622,11 +622,14 @@ describe Mixlib::ShellOut do
end
end
- it "doesn't hang or lose output when a process pauses before writing" do
- late_arrival = %q{ruby -e 'sleep 0.5;puts "missed_the_bus"'}
- cmd = Mixlib::ShellOut.new(late_arrival)
- cmd.run_command
- cmd.stdout.should == "missed_the_bus#{LINE_ENDING}"
+ context 'when subprocess pauses before writing' do
+ subject { stdout }
+ let(:late_arrival) { 'sleep 0.5; puts "missed_the_bus"' }
+ let(:cmd) { ruby_eval.call(late_arrival) }
+
+ it 'should not hang or lose output' do
+ should eql("missed_the_bus#{LINE_ENDING}")
+ end
end
it "uses the C locale by default" do