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