From 22e47aa24860b06bd6aec322ba85c253976d90b2 Mon Sep 17 00:00:00 2001 From: Aliaksandr Rahalevich Date: Fri, 8 Apr 2016 11:44:01 +0800 Subject: [PATCH] use proper options to create connection object --- lib/capybara/webkit/driver.rb | 2 +- spec/driver_spec.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/capybara/webkit/driver.rb b/lib/capybara/webkit/driver.rb index 47e38b2..0987afb 100644 --- a/lib/capybara/webkit/driver.rb +++ b/lib/capybara/webkit/driver.rb @@ -13,7 +13,7 @@ module Capybara::Webkit @app = app @options = options.dup @options[:server] ||= Server.new(options) - @browser = options[:browser] || Browser.new(Connection.new(options)) + @browser = options[:browser] || Browser.new(Connection.new(@options)) apply_options end diff --git a/spec/driver_spec.rb b/spec/driver_spec.rb index eede88b..e5e324c 100644 --- a/spec/driver_spec.rb +++ b/spec/driver_spec.rb @@ -16,6 +16,15 @@ describe Capybara::Webkit::Driver do "#{AppRunner.app_host}#{path}" end + context "configuration" do + let(:options) { AppRunner.configuration.to_hash } + + it "configures server automatically" do + expect { Capybara::Webkit::Driver.new(AppRunner.app, options) }. + to_not raise_error + end + end + context "iframe app" do let(:driver) do driver_for_app do