diff --git a/lib/rubocop/cop/jackpocket/sneakers_job_control_signal.rb b/lib/rubocop/cop/jackpocket/sneakers_job_control_signal.rb index de25e50..47543a2 100644 --- a/lib/rubocop/cop/jackpocket/sneakers_job_control_signal.rb +++ b/lib/rubocop/cop/jackpocket/sneakers_job_control_signal.rb @@ -34,7 +34,7 @@ class SneakersJobControlSignal < Base (... (send nil? {:ack! :reject! :requeue!})) PATTERN - MSG = 'The last line in `work` method must be `ack!`, `reject!`, or `requeue!`'.freeze + MSG = 'The `work` method must return `ack!`, `reject!`, or `requeue!`'.freeze def on_def(node) return unless node.method?(:work) && in_sneakers_worker?(node) diff --git a/spec/rubocop/cop/jackpocket/sneakers_job_control_signal_spec.rb b/spec/rubocop/cop/jackpocket/sneakers_job_control_signal_spec.rb index 1ac7c82..058c957 100644 --- a/spec/rubocop/cop/jackpocket/sneakers_job_control_signal_spec.rb +++ b/spec/rubocop/cop/jackpocket/sneakers_job_control_signal_spec.rb @@ -75,7 +75,7 @@ class TestWorker include Sneakers::Worker def work(message) - ^^^^^^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The last line in `work` method must be `ack!`, `reject!`, or `requeue!` + ^^^^^^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The `work` method must return `ack!`, `reject!`, or `requeue!` end end RUBY @@ -92,7 +92,7 @@ def work(message) do_something #{signal_name} rescue SomeError - ^^^^^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The last line in `work` method must be `ack!`, `reject!`, or `requeue!` + ^^^^^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The `work` method must return `ack!`, `reject!`, or `requeue!` end end RUBY @@ -107,10 +107,10 @@ class TestWorker def work(message) do_something - ^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The last line in `work` method must be `ack!`, `reject!`, or `requeue!` + ^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The `work` method must return `ack!`, `reject!`, or `requeue!` rescue SomeError handle_error - ^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The last line in `work` method must be `ack!`, `reject!`, or `requeue!` + ^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The `work` method must return `ack!`, `reject!`, or `requeue!` end end RUBY @@ -131,7 +131,7 @@ def work(message) #{signal_name} else do_else - ^^^^^^^ Jackpocket/SneakersJobControlSignal: The last line in `work` method must be `ack!`, `reject!`, or `requeue!` + ^^^^^^^ Jackpocket/SneakersJobControlSignal: The `work` method must return `ack!`, `reject!`, or `requeue!` end end RUBY @@ -147,7 +147,7 @@ def work(message) #{signal_name} rescue SomeError handle_error - ^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The last line in `work` method must be `ack!`, `reject!`, or `requeue!` + ^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The `work` method must return `ack!`, `reject!`, or `requeue!` else do_else #{signal_name} @@ -166,10 +166,10 @@ def work(message) #{signal_name} rescue SomeError handle_error - ^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The last line in `work` method must be `ack!`, `reject!`, or `requeue!` + ^^^^^^^^^^^^ Jackpocket/SneakersJobControlSignal: The `work` method must return `ack!`, `reject!`, or `requeue!` else do_else - ^^^^^^^ Jackpocket/SneakersJobControlSignal: The last line in `work` method must be `ack!`, `reject!`, or `requeue!` + ^^^^^^^ Jackpocket/SneakersJobControlSignal: The `work` method must return `ack!`, `reject!`, or `requeue!` end end RUBY