Method: RuboCop::Cop::RSpec::DescribedClass#on_block
- Defined in:
- lib/rubocop/cop/rspec/described_class.rb
permalink #on_block(node) ⇒ Object
rubocop:disable InternalAffairs/NumblockHandler
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/rubocop/cop/rspec/described_class.rb', line 100 def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler # In case the explicit style is used, we need to remember what's # being described. @described_class, body = described_constant(node) return unless body find_usage(body) do |match| msg = (match.const_name) add_offense(match, message: msg) do |corrector| autocorrect(corrector, match) end end end |