Method: RuboCop::Cop::RSpec::MultipleMemoizedHelpers#on_block
- Defined in:
- lib/rubocop/cop/rspec/multiple_memoized_helpers.rb
#on_block(node) ⇒ Object
rubocop:disable InternalAffairs/NumblockHandler
91 92 93 94 95 96 97 98 99 100 |
# File 'lib/rubocop/cop/rspec/multiple_memoized_helpers.rb', line 91 def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless spec_group?(node) count = all_helpers(node).uniq.count return if count <= max self.max = count add_offense(node, message: format(MSG, count: count, max: max)) end |