thoughtbot/capybara-webkit — pull request #617 by rupurt (2014-01-31 21:02:08+00:00)
Title: Close connection explicitly in test

This fixes a stderr redirection test on fast machines. The write pipe was getting closed before the redirection thread had a chance to copy it's contents into it. This affects multiple versions of ruby. We were seeing it on MRI 2.1.0 & JRuby 1.7.9.

The connection should always be explicitly closed in every test. This will ensure that threads don't live beyond the immediate test. I have only done this for the [connection spec](https://github.com/rupurt/capybara-webkit/blob/close-connection-explicitly/spec/connection_spec.rb), though this should be done throughout the entire suite eventually.