lib/rubocop/cop/capybara/specific_matcher.rb in rubocop-capybara-2.20.0 vs lib/rubocop/cop/capybara/specific_matcher.rb in rubocop-capybara-2.21.0
- old
+ new
@@ -21,11 +21,11 @@
# expect(page).to have_no_button(class: 'cls')
# expect(page).to have_button
# expect(page).to have_no_link('foo', class: 'cls', href: 'http://example.com')
# expect(page).to have_table(class: 'cls')
# expect(page).to have_select
- # expect(page).to have_field('foo')
+ # expect(page).to have_field(with: 'foo')
#
class SpecificMatcher < ::RuboCop::Cop::Base
MSG = 'Prefer `%<good_matcher>s` over `%<bad_matcher>s`.'
RESTRICT_ON_SEND = %i[have_selector have_no_selector have_css
have_no_css].freeze
@@ -36,15 +36,15 @@
'select' => 'select',
'input' => 'field'
}.freeze
# @!method first_argument(node)
- def_node_matcher :first_argument, <<-PATTERN
+ def_node_matcher :first_argument, <<~PATTERN
(send nil? _ (str $_) ... )
PATTERN
# @!method text_with_regexp?(node)
- def_node_search :text_with_regexp?, <<-PATTERN
+ def_node_search :text_with_regexp?, <<~PATTERN
(pair (sym {:text :exact_text}) (regexp ...))
PATTERN
def on_send(node)
first_argument(node) do |arg|