-
-
Notifications
You must be signed in to change notification settings - Fork 276
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 #1412 from rubocop/improve-no-expectation-example-…
…metadata Improve `RSpec/NoExpectationExample` cop to ignore examples skipped or pending via metadata
- Loading branch information
Showing
6 changed files
with
47 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module RuboCop | ||
module Cop | ||
module RSpec | ||
# Helps check offenses with variable definitions | ||
module SkipOrPending | ||
extend RuboCop::NodePattern::Macros | ||
|
||
# @!method skipped_in_metadata?(node) | ||
def_node_matcher :skipped_in_metadata?, <<-PATTERN | ||
{ | ||
(send _ _ <#skip_or_pending? ...>) | ||
(send _ _ ... (hash <(pair #skip_or_pending? { true str }) ...>)) | ||
} | ||
PATTERN | ||
|
||
# @!method skip_or_pending?(node) | ||
def_node_matcher :skip_or_pending?, '{(sym :skip) (sym :pending)}' | ||
end | ||
end | ||
end | ||
end |
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