Shopify/tcr — pull request #3 by girasquid (2014-10-29 19:21:12+00:00)
Title: Don't prepend OpenSSL::SSL::SSLSocket

@nwjsmith @peterjm @fw42 for review please

This is my test to confirm that this works:
```ruby
#!/usr/bin/env ruby

require 'bundler/setup'
require 'byebug'
require 'test/unit'
require 'tcr'

TCR.configure do |c|
c.cassette_library_dir = '.'
c.hook_tcp_ports = '*'
end
class TCRTCPSocketTest < Test::Unit::TestCase
def test_google_dot_com
TCR.use_cassette('google_ssl') do
a_socket = connect_to('google.com', 443)
a_socket.write('gibberish')
a_socket.close
end
end

def connect_to(host, port)
sock = TCPSocket.new(host, port)
ssl = OpenSSL::SSL::SSLSocket.new(sock, OpenSSL::SSL::SSLContext.new)
ssl.sync = true
ssl.connect
ssl.setsockopt Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1
ssl
end

end
```

Running the test without these changes fails like this:
```bash
ruby test.rb
Run options:

# Running tests:

[1/1] TCRTCPSocketTest#test_google_dot_com = 0.08 s
1) Error:
TCRTCPSocketTest#test_google_dot_com:
ArgumentError: wrong number of arguments (0 for 2+)
/home/vagrant/src/scratch/tcr/lib/tcr/socket_extension.rb:3:in `initialize'
/home/vagrant/src/scratch/tcr/lib/tcr/socket_extension.rb:4:in `initialize'
/home/vagrant/src/scratch/tcr/lib/tcr/socket_extension.rb:4:in `initialize'
test.rb:24:in `new'
test.rb:24:in `connect_to'
test.rb:16:in `block in test_google_dot_com'
/home/vagrant/src/scratch/tcr/lib/tcr.rb:48:in `use_cassette'
test.rb:15:in `test_google_dot_com'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1265:in `run'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/test/unit/testcase.rb:17:in `run'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/minitest/unit.rb:940:in `block in _run_suite'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/minitest/unit.rb:933:in `map'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/minitest/unit.rb:933:in `_run_suite'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/test/unit.rb:663:in `block in _run_suites'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/test/unit.rb:661:in `each'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/test/unit.rb:661:in `_run_suites'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/minitest/unit.rb:884:in `_run_anything'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1092:in `run_tests'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1079:in `block in _run'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1078:in `each'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1078:in `_run'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/minitest/unit.rb:1066:in `run'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/test/unit.rb:27:in `run'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/test/unit.rb:780:in `run'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/test/unit.rb:372:in `block (2 levels) in autorun'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/test/unit.rb:33:in `run_once'
/usr/lib/shopify-ruby/2.1.3-shopify1/lib/ruby/2.1.0/test/unit.rb:371:in `block in autorun'

Finished tests in 0.096612s, 10.3507 tests/s, 0.0000 assertions/s.
1 tests, 0 assertions, 0 failures, 1 errors, 0 skips

ruby -v: ruby 2.1.3p242-shopify (development) [x86_64-linux]
```

[Appears related to something about C extensions](https://gist.github.com/fw42/93727d046b827fab4751).