Class: RuboCop::Cop::RSpec::ImplicitBlockExpectation
- Defined in:
- lib/rubocop/cop/rspec/implicit_block_expectation.rb
Overview
Check that implicit block expectation syntax is not used.
Prefer using explicit block expectations.
Constant Summary collapse
- MSG =
'Avoid implicit block expectations.'
Instance Method Summary collapse
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language::NodePattern
Instance Method Details
#on_send(node) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/rubocop/cop/rspec/implicit_block_expectation.rb', line 35 def on_send(node) implicit_expect(node) do |implicit_expect| subject = nearest_subject(implicit_expect) add_offense(implicit_expect) if lambda_subject?(subject&.body) end end |