New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dont throw away ssl connection #54
base: master
Are you sure you want to change the base?
Conversation
@@ -6,7 +6,7 @@ | |||
let(:connection_options) { { certificate: '/path/to/cert.pem', | |||
gateway: 'push.example.com', | |||
port: 443 } } | |||
let(:ssl) { stub_everything('SSLConnection') } | |||
let(:ssl) { stub('SSLConnection', connect: nil, new: nil, write: nil, read: nil, disconnect: nil) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I prefer to tighten down the API when possible.
I find the mix of |
I wanted to do that, but didn't want to break backward compatibility. Does close sound good to you? |
Thanks @stevenharman |
@kbrock Can you mention the breaking changes in the Changelog? And feel free to add your own contributions to the list as well! :) |
a) made those changes |
@@ -75,6 +44,11 @@ | |||
subject.read(42, 'IO') | |||
ssl.should have_received(:read).with(42, 'IO') | |||
end | |||
|
|||
it "#close" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something more descriptive like it "delegates close to the ssl connection"
would be nice here.
I added timeout of Not going through If it slows down this pull request, just say the word and I can tear it out. |
add delegates don't throw away the ssl object, just disconnect
better guards around connection's calls to ssl connection (ensure no invalid methods are called)
…t no longer needs to hold onto the connection attributes.
a) no need to throw away ssl connection object, when a simple disconnect / close would do.
b) aliases disconnect to close, since that is the name of the methods on the underlying ruby classes.
c) test the few remaining methods that didn't have test coverage