diff options
author | Ho-Sheng Hsiao <hosheng.hsiao@gmail.com> | 2012-03-23 12:21:39 -0400 |
---|---|---|
committer | Ho-Sheng Hsiao <hosheng.hsiao@gmail.com> | 2012-03-23 12:21:39 -0400 |
commit | 72c5e95e976287805d3910073d7c0c4fe4324a98 (patch) | |
tree | ae64a2625892e8bc8ef8234fd9c49e82e373f714 | |
parent | d3c4419b6e0608b5f46eb92b2cd119c51f473adb (diff) | |
download | mixlib-shellout-72c5e95e976287805d3910073d7c0c4fe4324a98.tar.gz |
[RSPEC] Refactored spec for subprocess that exceeds buffersize
-rw-r--r-- | spec/mixlib/shellout/shellout_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/mixlib/shellout/shellout_spec.rb b/spec/mixlib/shellout/shellout_spec.rb index bc84be8..757c94a 100644 --- a/spec/mixlib/shellout/shellout_spec.rb +++ b/spec/mixlib/shellout/shellout_spec.rb @@ -552,11 +552,13 @@ describe Mixlib::ShellOut do end end - it "reads all of the output when the subprocess produces more than $buffersize of output" do - chatty = "ruby -e \"print('X' * 16 * 1024); print('.' * 1024)\"" - cmd = Mixlib::ShellOut.new(chatty) - cmd.run_command - cmd.stdout.should match(/X{16384}\.{1024}/) + context 'with subprocess that exceeds buffersize' do + let(:chatty) { 'print("X" * 16 * 1024); print("." * 1024)' } + let(:cmd) { ruby_eval.call(chatty) } + + it "should still reads all of the output" do + stdout.should match(/X{16384}\.{1024}/) + end end it "returns empty strings from commands that have no output" do |