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)
-
+ (Object) extended(klass)
(also: included)
Init data store for internal message capture.
Instance Method Summary (collapse)
-
- (Object) forward(payload)
Force payload into local store.
-
- (Array) forwarded
Forwarded payloads.
Class Method Details
+ (Object) extended(klass) 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
- (Object) forward(payload)
Force payload into local store
17 18 19 |
# File 'lib/jackal/utils/spec/callback_local.rb', line 17 def forward(payload) @forwarded << payload end |
- (Array) forwarded
Returns forwarded payloads
10 11 12 |
# File 'lib/jackal/utils/spec/callback_local.rb', line 10 def forwarded @forwarded ||= [] end |