minor code cleanup
This commit is contained in:
parent
aa41b072d3
commit
e0ce02554e
|
@ -12,11 +12,7 @@ module Capybara
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.wait(options)
|
def self.wait(options)
|
||||||
if options.has_key?(:wait)
|
options.fetch(:wait, Capybara.default_max_wait_time) || 0
|
||||||
options[:wait] || 0
|
|
||||||
else
|
|
||||||
Capybara.default_max_wait_time
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -83,23 +83,15 @@ module Capybara
|
||||||
|
|
||||||
def exact?
|
def exact?
|
||||||
return false if !supports_exact?
|
return false if !supports_exact?
|
||||||
if options.has_key?(:exact)
|
options.fetch(:exact, Capybara.exact)
|
||||||
@options[:exact]
|
|
||||||
else
|
|
||||||
Capybara.exact
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def match
|
def match
|
||||||
if options.has_key?(:match)
|
options.fetch(:match, Capybara.match)
|
||||||
@options[:match]
|
|
||||||
else
|
|
||||||
Capybara.match
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def xpath(exact=nil)
|
def xpath(exact=nil)
|
||||||
exact = self.exact? if exact == nil
|
exact = self.exact? if exact.nil?
|
||||||
if @expression.respond_to?(:to_xpath) and exact
|
if @expression.respond_to?(:to_xpath) and exact
|
||||||
@expression.to_xpath(:exact)
|
@expression.to_xpath(:exact)
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue