Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Pass fully qualified constants to #setsockopt
Browse files Browse the repository at this point in the history
Fixes #396.
  • Loading branch information
mhoran authored and p committed Jan 1, 2014
1 parent 578b8b5 commit 7ef2f9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/capybara/webkit/connection.rb
Expand Up @@ -113,7 +113,7 @@ def connect
def attempt_connect def attempt_connect
@socket = @socket_class.open("127.0.0.1", @port) @socket = @socket_class.open("127.0.0.1", @port)
if defined?(Socket::TCP_NODELAY) if defined?(Socket::TCP_NODELAY)
@socket.setsockopt(:IPPROTO_TCP, :TCP_NODELAY, 1) @socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)
end end
rescue Errno::ECONNREFUSED rescue Errno::ECONNREFUSED
end end
Expand Down
2 changes: 1 addition & 1 deletion spec/connection_spec.rb
Expand Up @@ -38,7 +38,7 @@
socket = stub('socket') socket = stub('socket')
TCPSocket.stub(:open).and_return(socket) TCPSocket.stub(:open).and_return(socket)
if defined?(Socket::TCP_NODELAY) if defined?(Socket::TCP_NODELAY)
socket.should_receive(:setsockopt).with(:IPPROTO_TCP, :TCP_NODELAY, 1) socket.should_receive(:setsockopt).with(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)
else else
socket.should_not_receive(:setsockopt) socket.should_not_receive(:setsockopt)
end end
Expand Down

0 comments on commit 7ef2f9b

Please sign in to comment.