Skip to content

Commit

Permalink
Merge pull request #1739 from rubocop/refactor
Browse files Browse the repository at this point in the history
Refactor for `RSpec/BeforeAfterAll`
  • Loading branch information
pirj authored Nov 14, 2023
2 parents 8dd01d1 + 2bddaed commit 6411145
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rubocop/cop/rspec/before_after_all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class BeforeAfterAll < Base
'`use_transactional_fixtures` is enabled, then records created ' \
'in `%<hook>s` are not automatically rolled back.'

RESTRICT_ON_SEND = %i[before after].freeze
RESTRICT_ON_SEND = Set[:before, :after].freeze

# @!method before_or_after_all(node)
def_node_matcher :before_or_after_all, <<-PATTERN
$(send _ {:before :after} (sym {:all :context}))
$(send _ RESTRICT_ON_SEND (sym {:all :context}))
PATTERN

def on_send(node)
Expand Down

0 comments on commit 6411145

Please sign in to comment.