Module: Jackal::Utils::Spec::CallbackLocal
- Defined in:
- lib/jackal/utils/spec/callback_local.rb
Overview
Callback helper module for isolated testing
Class Method Summary collapse
-
.extended(klass) ⇒ Object
(also: included)
Init data store for internal message capture.
Instance Method Summary collapse
-
#forward(payload) ⇒ Object
Force payload into local store.
-
#forwarded ⇒ Array
Forwarded payloads.
Class Method Details
.extended(klass) ⇒ Object Also known as: included
Init data store for internal message capture
23 24 25 26 27 |
# File 'lib/jackal/utils/spec/callback_local.rb', line 23 def extended(klass) klass.instance_eval do @forwarded = [] end end |
Instance Method Details
#forward(payload) ⇒ Object
Force payload into local store
17 18 19 |
# File 'lib/jackal/utils/spec/callback_local.rb', line 17 def forward(payload) @forwarded << payload end |
#forwarded ⇒ Array
Returns forwarded payloads.
10 11 12 |
# File 'lib/jackal/utils/spec/callback_local.rb', line 10 def forwarded @forwarded ||= [] end |