Permalink
Browse files

Update tests to expect the Net::HTTP behavior in forthcoming versions…

… of JRuby

The latest build identifies itself as Ruby 2.1.0, although its Net::HTTP
implementation still diverges a bit from MRI (due to having a different
underlying SSL implementation, I assume).
  • Loading branch information...
1 parent 61f52b5 commit d5654c7e21dc34534530fd2b8b648de4cedbdd6f @chrisk committed Nov 24, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 test/test_helper.rb
View
@@ -120,7 +120,9 @@ def setup_expectations_for_real_request(options = {})
OpenSSL::SSL::SSLSocket.expects(:new).with(socket, instance_of(OpenSSL::SSL::SSLContext)).returns(socket).at_least_once
socket.stubs(:sync_close=).returns(true)
socket.expects(:connect).with().at_least_once
- socket.expects(:session).with().at_least_once if RUBY_VERSION >= "2.0.0"
+ if RUBY_VERSION >= "2.0.0" && RUBY_PLATFORM != "java"
+ socket.expects(:session).with().at_least_once
+ end
else
socket = mock("TCPSocket")
Socket.expects(:===).with(socket).at_least_once.returns(true)

0 comments on commit d5654c7

Please sign in to comment.