Merge pull request #13921 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-rspec-2.13.2

build(deps): bump rubocop-rspec from 2.13.1 to 2.13.2 in /Library/Homebrew
This commit is contained in:
Mike McQuaid 2022-09-26 13:41:18 +01:00 committed by GitHub
commit d5b6b068c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
134 changed files with 37 additions and 19 deletions

View File

@ -143,7 +143,7 @@ GEM
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-rspec (2.13.1)
rubocop-rspec (2.13.2)
rubocop (~> 1.33)
rubocop-sorbet (0.6.11)
rubocop (>= 0.90.0)

View File

@ -182,6 +182,7 @@ class RuboCop::Cop::RSpec::Capybara::SpecificFinders < ::RuboCop::Cop::RSpec::Ba
private
def attribute?(arg); end
def end_pos(node); end
def offense_range(node); end
def on_attr(node, arg); end
def on_id(node, arg); end
@ -1235,6 +1236,7 @@ RuboCop::Cop::RSpec::NestedGroups::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::RSpec::NoExpectationExample < ::RuboCop::Cop::RSpec::Base
def including_any_expectation?(param0); end
def including_any_skip_example?(param0); end
def on_block(node); end
def on_numblock(node); end
def regular_or_focused_example?(param0 = T.unsafe(nil)); end

View File

@ -4936,6 +4936,7 @@ module RuboCop::AST::NodePattern::Sets
SET_KEYS_VALUES_TO_H_TO_XML = ::T.let(nil, ::T.untyped)
SET_ON_INTEL_ON_ARM = ::T.let(nil, ::T.untyped)
SET_OR_NEWER_OR_OLDER = ::T.let(nil, ::T.untyped)
SET_PENDING_SKIP = ::T.let(nil, ::T.untyped)
SET_SYSTEM_SHELL_OUTPUT_PIPE_OUTPUT = ::T.let(nil, ::T.untyped)
SET_TIME_DATETIME = ::T.let(nil, ::T.untyped)
SET_WITH_WITHOUT = ::T.let(nil, ::T.untyped)

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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