lib/rubocop/cop/rspec/let_setup.rb in rubocop-rspec-2.18.1 vs lib/rubocop/cop/rspec/let_setup.rb in rubocop-rspec-2.19.0
- old
+ new
@@ -27,17 +27,15 @@
# end
class LetSetup < Base
MSG = 'Do not use `let!` to setup objects not referenced in tests.'
# @!method example_or_shared_group_or_including?(node)
- def_node_matcher :example_or_shared_group_or_including?,
- block_pattern(<<~PATTERN)
- {
- #SharedGroups.all
- #ExampleGroups.all
- #Includes.all
- }
- PATTERN
+ def_node_matcher :example_or_shared_group_or_including?, <<~PATTERN
+ (block {
+ (send #rspec? {#SharedGroups.all #ExampleGroups.all} ...)
+ (send nil? #Includes.all ...)
+ } ...)
+ PATTERN
# @!method let_bang(node)
def_node_matcher :let_bang, <<-PATTERN
{
(block $(send nil? :let! {(sym $_) (str $_)}) ...)