Class: Amigo::SpecHelpers::ServerCallbackMiddleware
- Inherits:
-
Object
- Object
- Amigo::SpecHelpers::ServerCallbackMiddleware
- Defined in:
- lib/amigo/spec_helpers.rb
Overview
Use this middleware to pass an arbitrary callback evaluated before a job runs. Make sure to call reset
after the test.
Class Attribute Summary collapse
-
.callback ⇒ Object
Returns the value of attribute callback.
Class Method Summary collapse
Class Attribute Details
.callback ⇒ Object
Returns the value of attribute callback.
279 280 281 |
# File 'lib/amigo/spec_helpers.rb', line 279 def callback @callback end |
Class Method Details
.call(worker, job, queue) ⇒ Object
291 292 293 294 |
# File 'lib/amigo/spec_helpers.rb', line 291 def self.call(worker, job, queue) self.callback[worker, job, queue] if self.callback yield end |
.new ⇒ Object
287 288 289 |
# File 'lib/amigo/spec_helpers.rb', line 287 def self.new return self end |
.reset ⇒ Object
282 283 284 285 |
# File 'lib/amigo/spec_helpers.rb', line 282 def self.reset self.callback = nil return self end |