cucumber/aruba — pull request #150 by JonRowe (2013-05-08 10:42:42+00:00)
Title: Close files on SpawnProcess#stop

Alternate implementation to #149

`SpawnProcess` creates files to use for stdout and stderr which are opened but never closed, this leaks file descriptors that eventually cause larger test suites to fail on some systems (I encountered this with [rspec-core](/rspec/rspec-core) ).

This implementation closes the tmp files during the `SpawnProcess#stop(reader)` thus cleaning up the files and preventing the issue, however this causes an issue if steps attempt to access the files after the process has finished, to handle that eventuality the output of reading the streams is captured and used in the event of an `IOError`.