Update test suite to be compatible with Ruby 2

`net/http` in Ruby 2 changed a bit and it now calls `TCPSocket.open` with more options as well as `session()` for a socket over SSL.

This patch simply adjust the mocking in `test_helper.rb` for Ruby 2 leaving previous versions untouched. Please accept.