Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ruby 2.1.0-compat: update tests to match Net::HTTP's TCP_NODELAY opti…

…mization
  • Loading branch information...
commit e30d22030136a8c841a4fa63a1978144c11582a7 1 parent 4dd2f1f
@chrisk authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 test/test_helper.rb
View
5 test/test_helper.rb
@@ -125,6 +125,11 @@ def setup_expectations_for_real_request(options = {})
Socket.expects(:===).with(socket).at_least_once.returns(true)
end
+ # Net::HTTP#connect now sets TCP_NODELAY after opening the socket. See ruby-core:56158.
+ if RUBY_VERSION >= "2.1.0"
+ socket.stubs(:setsockopt).returns(0)
+ end
+
if RUBY_VERSION >= "2.0.0"
TCPSocket.expects(:open).with(options[:host], options[:port], nil, nil).returns(socket).at_least_once
else
Please sign in to comment.
Something went wrong with that request. Please try again.