mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
18 lines
564 B
Ruby
18 lines
564 B
Ruby
require 'spec_helper'
|
|
require 'capybara/webkit/connection'
|
|
|
|
describe Capybara::Webkit::Connection do
|
|
it "sets appropriate options on its socket" do
|
|
socket = double("socket")
|
|
server = double(:Server, start: nil, port: 123)
|
|
allow(TCPSocket).to receive(:open).and_return(socket)
|
|
if defined?(Socket::TCP_NODELAY)
|
|
expect(socket).to receive(:setsockopt).
|
|
with(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)
|
|
else
|
|
expect(socket).not_to receive(:setsockopt)
|
|
end
|
|
|
|
Capybara::Webkit::Connection.new(server: server)
|
|
end
|
|
end
|