-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13163 from Homebrew/dependabot/bundler/Library/Ho…
…mebrew/rubocop-rspec-2.10.0 build(deps): bump rubocop-rspec from 2.9.0 to 2.10.0 in /Library/Homebrew
- Loading branch information
Showing
124 changed files
with
260 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 31 additions & 35 deletions
66
...w/sorbet/rbi/gems/rubocop-rspec@2.9.0.rbi → .../sorbet/rbi/gems/rubocop-rspec@2.10.0.rbi
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
74 changes: 74 additions & 0 deletions
74
...mebrew/vendor/bundle/ruby/2.6.0/gems/rubocop-rspec-2.10.0/lib/rubocop/cop/rspec/be_nil.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# frozen_string_literal: true | ||
|
||
module RuboCop | ||
module Cop | ||
module RSpec | ||
# Ensures a consistent style is used when matching `nil`. | ||
# | ||
# You can either use the more specific `be_nil` matcher, or the more | ||
# generic `be` matcher with a `nil` argument. | ||
# | ||
# This cop can be configured using the `EnforcedStyle` option | ||
# | ||
# @example `EnforcedStyle: be_nil` (default) | ||
# # bad | ||
# expect(foo).to be(nil) | ||
# | ||
# # good | ||
# expect(foo).to be_nil | ||
# | ||
# @example `EnforcedStyle: be` | ||
# # bad | ||
# expect(foo).to be_nil | ||
# | ||
# # good | ||
# expect(foo).to be(nil) | ||
# | ||
class BeNil < Base | ||
extend AutoCorrector | ||
include ConfigurableEnforcedStyle | ||
|
||
BE_MSG = 'Prefer `be(nil)` over `be_nil`.' | ||
BE_NIL_MSG = 'Prefer `be_nil` over `be(nil)`.' | ||
RESTRICT_ON_SEND = %i[be be_nil].freeze | ||
|
||
# @!method be_nil_matcher?(node) | ||
def_node_matcher :be_nil_matcher?, <<-PATTERN | ||
(send nil? :be_nil) | ||
PATTERN | ||
|
||
# @!method nil_value_expectation?(node) | ||
def_node_matcher :nil_value_expectation?, <<-PATTERN | ||
(send nil? :be nil) | ||
PATTERN | ||
|
||
def on_send(node) | ||
case style | ||
when :be | ||
check_be_style(node) | ||
when :be_nil | ||
check_be_nil_style(node) | ||
end | ||
end | ||
|
||
private | ||
|
||
def check_be_style(node) | ||
return unless be_nil_matcher?(node) | ||
|
||
add_offense(node, message: BE_MSG) do |corrector| | ||
corrector.replace(node.loc.expression, 'be(nil)') | ||
end | ||
end | ||
|
||
def check_be_nil_style(node) | ||
return unless nil_value_expectation?(node) | ||
|
||
add_offense(node, message: BE_NIL_MSG) do |corrector| | ||
corrector.replace(node.loc.expression, 'be_nil') | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.