summaryrefslogtreecommitdiff
path: root/spec/mixlib/shellout
diff options
context:
space:
mode:
authorHo-Sheng Hsiao <hosheng.hsiao@gmail.com>2012-03-26 18:12:00 -0400
committerHo-Sheng Hsiao <hosheng.hsiao@gmail.com>2012-03-26 18:12:00 -0400
commit3fb28af15fd0dd47cf81b92758a3ebf30627674e (patch)
treee0e2051acc3c791aa4c041ed1e847e4d6895eefb /spec/mixlib/shellout
parentab7aae4c7c5908a775d68c0a2520e9b3c93e8861 (diff)
downloadmixlib-shellout-3fb28af15fd0dd47cf81b92758a3ebf30627674e.tar.gz
[CHEF-2994][RSPEC] ShellOut#run_command when execution fails with input should recover the error message
Diffstat (limited to 'spec/mixlib/shellout')
-rw-r--r--spec/mixlib/shellout/shellout_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/mixlib/shellout/shellout_spec.rb b/spec/mixlib/shellout/shellout_spec.rb
index b61c881..7d37a3e 100644
--- a/spec/mixlib/shellout/shellout_spec.rb
+++ b/spec/mixlib/shellout/shellout_spec.rb
@@ -801,6 +801,15 @@ describe Mixlib::ShellOut do
it "should recover the error message" do
lambda { executed_cmd }.should raise_error(Errno::ENOENT)
end
+
+ context 'with input' do
+ let(:options) { {:input => input } }
+ let(:input) { "Random input #{rand(1000000)}" }
+
+ it "should recover the error message" do
+ lambda { executed_cmd }.should raise_error(Errno::ENOENT)
+ end
+ end
end
context 'without input data' do