brew vendor-gems: commit updates.
This commit is contained in:
parent
c3ff984beb
commit
bbd2d50478
@ -89,7 +89,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unicode-display_width
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.35.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.15.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.16.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.13.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.13.2/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.11/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-3.0.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-html-0.12.3/lib"
|
||||
|
||||
@ -76,8 +76,15 @@ module RuboCop
|
||||
end
|
||||
|
||||
def offense_range(node)
|
||||
range_between(node.loc.selector.begin_pos,
|
||||
node.loc.end.end_pos)
|
||||
range_between(node.loc.selector.begin_pos, end_pos(node))
|
||||
end
|
||||
|
||||
def end_pos(node)
|
||||
if node.loc.end
|
||||
node.loc.end.end_pos
|
||||
else
|
||||
node.loc.expression.end_pos
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -29,20 +29,20 @@ module RuboCop
|
||||
class VisibilityMatcher < Base
|
||||
MSG_FALSE = 'Use `:all` or `:hidden` instead of `false`.'
|
||||
MSG_TRUE = 'Use `:visible` instead of `true`.'
|
||||
CAPYBARA_MATCHER_METHODS = %i[
|
||||
have_selector
|
||||
have_css
|
||||
have_xpath
|
||||
have_link
|
||||
have_button
|
||||
have_field
|
||||
have_select
|
||||
have_table
|
||||
have_checked_field
|
||||
have_unchecked_field
|
||||
have_text
|
||||
have_content
|
||||
].freeze
|
||||
CAPYBARA_MATCHER_METHODS = %w[
|
||||
button
|
||||
checked_field
|
||||
css
|
||||
field
|
||||
link
|
||||
select
|
||||
selector
|
||||
table
|
||||
unchecked_field
|
||||
xpath
|
||||
].flat_map do |element|
|
||||
["have_#{element}".to_sym, "have_no_#{element}".to_sym]
|
||||
end
|
||||
|
||||
RESTRICT_ON_SEND = CAPYBARA_MATCHER_METHODS
|
||||
|
||||
@ -49,10 +49,18 @@ module RuboCop
|
||||
send_pattern('#Expectations.all')
|
||||
)
|
||||
|
||||
# @!method including_any_skip_example?(node)
|
||||
# @param [RuboCop::AST::Node] node
|
||||
# @return [Boolean]
|
||||
def_node_search :including_any_skip_example?, <<~PATTERN
|
||||
(send nil? {:pending :skip} ...)
|
||||
PATTERN
|
||||
|
||||
# @param [RuboCop::AST::BlockNode] node
|
||||
def on_block(node)
|
||||
return unless regular_or_focused_example?(node)
|
||||
return if including_any_expectation?(node)
|
||||
return if including_any_skip_example?(node)
|
||||
|
||||
add_offense(node)
|
||||
end
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user