Class: RuboCop::Cop::Carwow::NoStubbingBusinessEvent
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Carwow::NoStubbingBusinessEvent
- Defined in:
- lib/rubocop/cop/carwow/no_stubbing_business_event.rb
Overview
Never mock (or double) the BusinessEvent class, it won’t validate the schema and it reduces the quality of your tests!
[See discussion](carwow.discourse.team/t/schema-validations-for-business-events/414)
Constant Summary collapse
- RESTRICT_ON_SEND =
optimization: don’t call ‘on_send` unless the method name is in this list
i[allow expect].freeze
- MSG =
'Stub BusinessEvent is discouraged!'
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
41 42 43 44 45 |
# File 'lib/rubocop/cop/carwow/no_stubbing_business_event.rb', line 41 def on_send(node) stub_on_business_event?(node) do add_offense(node) end end |