minor code cleanup

This commit is contained in:
Thomas Walpole 2016-08-31 10:21:22 -07:00
parent aa41b072d3
commit e0ce02554e
2 changed files with 4 additions and 16 deletions

View File

@ -12,11 +12,7 @@ module Capybara
end
def self.wait(options)
if options.has_key?(:wait)
options[:wait] || 0
else
Capybara.default_max_wait_time
end
options.fetch(:wait, Capybara.default_max_wait_time) || 0
end
private

View File

@ -83,23 +83,15 @@ module Capybara
def exact?
return false if !supports_exact?
if options.has_key?(:exact)
@options[:exact]
else
Capybara.exact
end
options.fetch(:exact, Capybara.exact)
end
def match
if options.has_key?(:match)
@options[:match]
else
Capybara.match
end
options.fetch(:match, Capybara.match)
end
def xpath(exact=nil)
exact = self.exact? if exact == nil
exact = self.exact? if exact.nil?
if @expression.respond_to?(:to_xpath) and exact
@expression.to_xpath(:exact)
else