Skip to content

Commit

Permalink
rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Apr 5, 2019
1 parent 0f1c573 commit 0e4e6ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/capybara/selector/selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def initialize(definition, config:, format:)
def format
@format || @definition.default_format
end
alias_method :current_format, :format

def enable_aria_label
@config[:enable_aria_label]
Expand All @@ -239,7 +240,7 @@ def add_error(error_msg)
errors << error_msg
end

def expression_for(name, locator, config: @config, format: format, **options)
def expression_for(name, locator, config: @config, format: current_format, **options)
Selector.new(name, config: config, format: format).call(locator, **options)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/selector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@

describe 'xpath' do
it 'uses filter names passed in' do
selector = Capybara.add_selector :test do
Capybara.add_selector :test do
xpath(:something, :other) { |_locator| XPath.descendant }
end
selector = Capybara::Selector.new :test, config: nil, format: nil
Expand Down

0 comments on commit 0e4e6ea

Please sign in to comment.