Class: BackgroundLite::TestHandler
- Defined in:
- lib/background_lite/core_ext/handlers/test_handler.rb
Overview
This handler is used in a testing environment. It allows for introspection of last call to the handle method.
Class Method Summary collapse
-
.handle(object, method, args, options = {}) ⇒ Object
Does not call the block, but sets some variables for introspection.
-
.reset ⇒ Object
Resets the class’ accessors.
Class Method Details
.handle(object, method, args, options = {}) ⇒ Object
Does not call the block, but sets some variables for introspection.
20 21 22 23 24 25 26 27 28 |
# File 'lib/background_lite/core_ext/handlers/test_handler.rb', line 20 def self.handle(object, method, args, = {}) self.executed = true if self.fail_next_time self.fail_next_time = false raise "TestHandler.handle: Failed on purpose" end self.object, self.method, self.args, self. = object, method, args, end |
.reset ⇒ Object
Resets the class’ accessors.
31 32 33 |
# File 'lib/background_lite/core_ext/handlers/test_handler.rb', line 31 def self.reset object = method = args = = fail_next_time = executed = nil end |