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.