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