diff options
author | lamont-granquist <lamont@scriptkiddie.org> | 2013-06-14 13:16:55 -0700 |
---|---|---|
committer | lamont-granquist <lamont@scriptkiddie.org> | 2013-06-14 13:16:55 -0700 |
commit | 29ea7170762c01fd0e107a81e5aecde9a298099b (patch) | |
tree | 591461c080bc2bab76a7a76af40e818bf7e58b6f /spec/mixlib/shellout_spec.rb | |
parent | b2878614b555148a4f79bf9dbc04ab3475b8c0a9 (diff) | |
parent | 6526c3c7ee383318747dafb2b08933aed84985f5 (diff) | |
download | mixlib-shellout-29ea7170762c01fd0e107a81e5aecde9a298099b.tar.gz |
Merge pull request #19 from opscode/lcg/fd-close-exception
Lcg/fd close exception
Diffstat (limited to 'spec/mixlib/shellout_spec.rb')
-rw-r--r-- | spec/mixlib/shellout_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index 2020dda..131c5e1 100644 --- a/spec/mixlib/shellout_spec.rb +++ b/spec/mixlib/shellout_spec.rb @@ -1013,5 +1013,19 @@ describe Mixlib::ShellOut do end end end + + describe "#clean_parent_file_descriptors" do + # test for for_fd returning a valid File object, but close + # throwing EBADF. + it "should not throw an exception if fd.close throws EBADF" do + fd = mock('File') + fd.stub!(:close).at_least(:once).and_raise(Errno::EBADF) + File.should_receive(:for_fd).at_least(:once).and_return(fd) + shellout = Mixlib::ShellOut.new() + shellout.instance_variable_set(:@process_status_pipe, [ 98, 99 ]) + lambda { shellout.send(:clean_parent_file_descriptors) }.should_not raise_error + end + end + end end |