Class: RuboCop::Cop::Sidekiq::AsyncInTest
- Defined in:
- lib/rubocop/cop/sidekiq/async_in_test.rb
Overview
Checks for perform_async usage in test files.
Constant Summary collapse
- MSG =
'Avoid perform_async in tests. Use perform_inline or call perform directly.'- RESTRICT_ON_SEND =
%i[perform_async].freeze
Instance Method Summary collapse
- #on_send(node) ⇒ Object (also: #on_csend)
Methods included from Sidekiq::Language
#active_job_class?, #perform_call?, #sidekiq_include?, #sidekiq_options_call?
Instance Method Details
#on_send(node) ⇒ Object Also known as: on_csend
20 21 22 23 24 |
# File 'lib/rubocop/cop/sidekiq/async_in_test.rb', line 20 def on_send(node) return unless in_test_file? add_offense(node) end |