1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Deprecate Capybara.exact_options

This commit is contained in:
Thomas Walpole 2017-11-19 11:16:18 -08:00
parent e7ed2a12be
commit 4bde730600
3 changed files with 12 additions and 1 deletions

View file

@ -39,6 +39,7 @@ module Capybara
# See {Capybara.configure}
#@!method save_path
# See {Capybara.configure}
#@deprecated
#@!method exact_options
# See {Capybara.configure}
#@!method asset_host
@ -90,6 +91,13 @@ module Capybara
@save_and_open_page_path = path
end
remove_method :exact_options=
def exact_options=(opt)
@exact_options = opt
warn "DEPRECATED: #exact_options is deprecated, please scope your findes/actions and use the `:exact` "\
"option if similar functionality is needed."
end
def initialize_copy(other)
super
@server_errors = @server_errors.dup

View file

@ -24,6 +24,7 @@ Capybara::SpecHelper.spec "#select" do
end
it "should not allow selecting options where they are the only inexact match if `Capybara.exact_options = true`" do
expect_any_instance_of(Kernel).to receive(:warn).with(/^DEPRECATED:/)
Capybara.exact_options = true
expect do
@session.select("Mis", from: 'Title')

View file

@ -33,7 +33,9 @@ module Capybara
Capybara.default_max_wait_time = 1
Capybara.ignore_hidden_elements = true
Capybara.exact = false
Capybara.exact_options = false
# `exact_options` is deprecated - set instancce var directly so we
# don't generate message every reset
Capybara.send(:config).session_options.instance_variable_set('@exact_options', false)
Capybara.raise_server_errors = true
Capybara.visible_text_only = false
Capybara.match = :smart