thoughtbot/capybara-webkit — pull request #309 by derekprior (2012-03-30 17:16:17+00:00)
Title: Read from socket only when there's content

This works around an issue with the TCPSocket class in jruby that causes
it to block indefinitely while trying to read a non-existent response.
MRI will immediately return an empty string.

The fix was to a private method and required stubbing an instance
variable not publically accessible so the specs have to get kind of cute
to work around this.

This pull request closes issue #197 and supersedes pull request #220
(which had broken specs). Credit @duelinmarkers.