diff options
author | Ho-Sheng Hsiao <hosheng.hsiao@gmail.com> | 2012-03-26 16:58:14 -0400 |
---|---|---|
committer | Ho-Sheng Hsiao <hosheng.hsiao@gmail.com> | 2012-03-26 16:58:14 -0400 |
commit | 837cc108afc9c72ce2977c807d9b63008ea660d4 (patch) | |
tree | 78deed823e80669e759cb143fae0adb7352d0a31 /spec | |
parent | 318c5572bc6cd1f3452760558bbb9da8b3b6dc9d (diff) | |
download | mixlib-shellout-837cc108afc9c72ce2977c807d9b63008ea660d4.tar.gz |
[CHEF-2994][STDIN] Child process should accept stdin input if input is specified
Diffstat (limited to 'spec')
-rw-r--r-- | spec/mixlib/shellout/shellout_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/mixlib/shellout/shellout_spec.rb b/spec/mixlib/shellout/shellout_spec.rb index 59afce0..81f58d6 100644 --- a/spec/mixlib/shellout/shellout_spec.rb +++ b/spec/mixlib/shellout/shellout_spec.rb @@ -365,6 +365,19 @@ describe Mixlib::ShellOut do end end + # FIXME: Add Windows support + context "with an input", :unix_only => true do + subject { stdout } + + let(:input) { 'hello' } + let(:ruby_code) { 'STDIN.sync = true; STDOUT.sync = true; puts gets' } + let(:options) { { :input => input } } + + it "should copy the input to the child's stdin" do + should eql("hello#{LINE_ENDING}") + end + end + context "when running different types of command" do context 'with spaces in the path' do subject { chomped_stdout } |