mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Fix not initalized instance variable warning
This commit is contained in:
parent
3a300955f5
commit
218e3843fb
2 changed files with 5 additions and 2 deletions
|
@ -12,8 +12,11 @@ module Capybara
|
|||
end
|
||||
|
||||
class IdentityExpressionFilter < ExpressionFilter
|
||||
def initialize; end
|
||||
def initialize(name)
|
||||
super(name, nil, nil)
|
||||
end
|
||||
def default?; false; end
|
||||
def matcher?; false; end
|
||||
def apply_filter(expr, _name, _value); expr; end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -223,7 +223,7 @@ module Capybara
|
|||
def xpath(*allowed_filters, &block)
|
||||
if block
|
||||
@format, @expression = :xpath, block
|
||||
allowed_filters.flatten.each { |ef| expression_filters[ef] = Filters::IdentityExpressionFilter.new }
|
||||
allowed_filters.flatten.each { |ef| expression_filters[ef] = Filters::IdentityExpressionFilter.new(ef) }
|
||||
end
|
||||
format == :xpath ? @expression : nil
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue