1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/spec/connection_spec.rb

19 lines
564 B
Ruby
Raw Normal View History

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)
2017-02-03 14:20:27 -05:00
allow(TCPSocket).to receive(:open).and_return(socket)
if defined?(Socket::TCP_NODELAY)
2017-02-03 14:20:27 -05:00
expect(socket).to receive(:setsockopt).
with(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)
else
2017-02-03 14:20:27 -05:00
expect(socket).not_to receive(:setsockopt)
end
Capybara::Webkit::Connection.new(server: server)
end
end