diff options
author | danielsdeleo <dan@opscode.com> | 2013-11-01 17:26:25 -0700 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-11-01 17:26:25 -0700 |
commit | 99001519bb950cda8983a8f270b45845ce349a45 (patch) | |
tree | d114a2981d2ba74e0fba8c149b00ca1da21d071c /spec/mixlib | |
parent | bc60d9b2abfbf64c848ff2e7bdb5cb69d3d84577 (diff) | |
download | mixlib-shellout-99001519bb950cda8983a8f270b45845ce349a45.tar.gz |
Cleanup control flow in main loop
removes some complexity that was introduced with the fix to kill
timed-out child processes
Diffstat (limited to 'spec/mixlib')
-rw-r--r-- | spec/mixlib/shellout_spec.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index d068dfc..ec2df8f 100644 --- a/spec/mixlib/shellout_spec.rb +++ b/spec/mixlib/shellout_spec.rb @@ -839,9 +839,11 @@ describe Mixlib::ShellOut do end it "should ask the process nicely to exit" do - lambda { executed_cmd }.should raise_error(Mixlib::ShellOut::CommandTimeout) - executed_cmd.stdout.should include("got term") - executed_cmd.exitstatus.should == 123 + # note: let blocks don't correctly memoize if an exception is raised, + # so can't use executed_cmd + lambda { shell_cmd.run_command }.should raise_error(Mixlib::ShellOut::CommandTimeout) + shell_cmd.stdout.should include("got term") + shell_cmd.exitstatus.should == 123 end context "and the child is unresponsive" do @@ -854,9 +856,11 @@ describe Mixlib::ShellOut do end it "should KILL the wayward child" do - lambda { executed_cmd }.should raise_error(Mixlib::ShellOut::CommandTimeout) - executed_cmd.stdout.should include("nanana cant hear you") - executed_cmd.status.termsig.should == 9 + # note: let blocks don't correctly memoize if an exception is raised, + # so can't use executed_cmd + lambda { shell_cmd.run_command}.should raise_error(Mixlib::ShellOut::CommandTimeout) + shell_cmd.stdout.should include("nanana cant hear you") + shell_cmd.status.termsig.should == 9 end end end |