mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
e382792352
The specializations are stored in a class instance variable. However, they are accessed from the specialize_driver method via `self.class`. Previously if this method was called on an instance of a subclass of Selenium::Driver, then it accessed the class instance variable associated with the subclass (which is nil by default) and not the class instance variable associated with the Selenium::Driver class as intended resulting in an exception like this: NoMethodError: private method `select' called for nil:NilClass ./lib/capybara/selenium/driver.rb:417:in `specialize_driver' ./lib/capybara/selenium/driver.rb:49:in `browser' ./lib/capybara/selenium/driver.rb:66:in `visit' ./lib/capybara/session.rb:277:in `visit' ./spec/selenium_spec_chrome.rb:118:in `block (3 levels) in <top (required)>' This commit adds a spec using a subclass of Selenium::Driver with Chrome to demonstrate the problem and fixes it by changing the specialize_driver method to access the specializations via the explicitly specified class name. An alternative fix would be to use a class variable for specializations and do away with the class attribute reader altogether. |
||
---|---|---|
.. | ||
fixtures | ||
rspec | ||
basic_node_spec.rb | ||
capybara_spec.rb | ||
css_builder_spec.rb | ||
css_splitter_spec.rb | ||
dsl_spec.rb | ||
filter_set_spec.rb | ||
minitest_spec.rb | ||
minitest_spec_spec.rb | ||
per_session_config_spec.rb | ||
rack_test_spec.rb | ||
regexp_dissassembler_spec.rb | ||
result_spec.rb | ||
rspec_matchers_spec.rb | ||
rspec_spec.rb | ||
sauce_spec_chrome.rb | ||
selector_spec.rb | ||
selenium_spec_chrome.rb | ||
selenium_spec_chrome_remote.rb | ||
selenium_spec_edge.rb | ||
selenium_spec_firefox.rb | ||
selenium_spec_firefox_remote.rb | ||
selenium_spec_ie.rb | ||
selenium_spec_safari.rb | ||
server_spec.rb | ||
session_spec.rb | ||
shared_selenium_session.rb | ||
spec_helper.rb | ||
xpath_builder_spec.rb |