Skip to content
This repository
Browse code

Pass through options to drivers, final puzzle piece!

  • Loading branch information...
commit 4c6c5cd4fad5d256ac54544d80421f0c837a2e14 1 parent be6aaa9
Jonas Nicklas authored
2  Gemfile.lock
@@ -25,9 +25,9 @@ GEM
25 25 configuration (>= 0.0.5)
26 26 rake (>= 0.8.1)
27 27 mime-types (1.16)
  28 + nokogiri (1.4.2)
28 29 nokogiri (1.4.2-java)
29 30 weakling (>= 0.0.3)
30   - nokogiri (1.4.2)
31 31 rack (1.2.1)
32 32 rack-test (0.5.4)
33 33 rack (>= 1.0)
5 lib/capybara/driver/celerity_driver.rb
@@ -84,10 +84,11 @@ def select_node
84 84
85 85 end
86 86
87   - attr_reader :app, :rack_server
  87 + attr_reader :app, :rack_server, :options
88 88
89   - def initialize(app)
  89 + def initialize(app, options={})
90 90 @app = app
  91 + @options = options
91 92 @rack_server = Capybara::Server.new(@app)
92 93 @rack_server.boot if Capybara.run_server
93 94 end
2  lib/capybara/driver/culerity_driver.rb
@@ -14,7 +14,7 @@ def self.server
14 14
15 15 def browser
16 16 unless @_browser
17   - @_browser = ::Culerity::RemoteBrowserProxy.new self.class.server, {:browser => :firefox, :log_level => :off}
  17 + @_browser = ::Culerity::RemoteBrowserProxy.new self.class.server, options
18 18 at_exit do
19 19 @_browser.close
20 20 @_browser.exit
4 lib/capybara/driver/selenium_driver.rb
@@ -61,7 +61,7 @@ def tag_name
61 61 def visible?
62 62 native.displayed? and native.displayed? != "false"
63 63 end
64   -
  64 +
65 65 def find(locator)
66 66 native.find_elements(:xpath, locator).map { |n| self.class.new(driver, n) }
67 67 end
@@ -83,7 +83,7 @@ def type
83 83
84 84 def browser
85 85 unless @browser
86   - @browser = Selenium::WebDriver.for(options[:browser] || :firefox)
  86 + @browser = Selenium::WebDriver.for(options.delete(:browser) || :firefox, options)
87 87 at_exit do
88 88 @browser.quit
89 89 end

0 comments on commit 4c6c5cd

Please sign in to comment.
Something went wrong with that request. Please try again.