Class: RuboCop::Cop::Sevencop::RSpecMemoizedHelperBlockDelimiter
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Sevencop::RSpecMemoizedHelperBlockDelimiter
- Extended by:
- AutoCorrector
- Includes:
- ConfigurableEnforcedStyle, RangeHelp
- Defined in:
- lib/rubocop/cop/sevencop/rspec_memoized_helper_block_delimiter.rb
Overview
Use do-end block delimiter on RSpec memoized helper.
Since these helpers define methods, they should be written in the same style as ‘def`.
Constant Summary collapse
- MSG =
'Use do-end block delimiter on RSpec memoized helper.'
Instance Method Summary collapse
Instance Method Details
#on_block(node) ⇒ void
This method returns an undefined value.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rubocop/cop/sevencop/rspec_memoized_helper_block_delimiter.rb', line 36 def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler return unless bad?(node) add_offense( node.location.begin.with( end_pos: node.location.end.end_pos ) ) do |corrector| autocorrect(corrector, node) end end |