Module: RubyReactor::RSpec::Helpers
- Defined in:
- lib/ruby_reactor/rspec/helpers.rb
Overview
Globally-included helpers. Only methods whose names clearly belong to
RubyReactor's test surface live here (test_reactor). Sidekiq-coupled
helpers live in SidekiqHelpers and are scoped to type: :reactor.
Instance Method Summary collapse
-
#test_reactor(reactor_class, inputs, context: {}, async: nil, process_jobs: true) ⇒ Object
Build a
TestSubjectaround a reactor invocation.
Instance Method Details
#test_reactor(reactor_class, inputs, context: {}, async: nil, process_jobs: true) ⇒ Object
Build a TestSubject around a reactor invocation. Captures the run for
later introspection via matchers; runs the reactor lazily on first
query unless .run is called explicitly.
12 13 14 15 16 17 18 19 20 |
# File 'lib/ruby_reactor/rspec/helpers.rb', line 12 def test_reactor(reactor_class, inputs, context: {}, async: nil, process_jobs: true) TestSubject.new( reactor_class: reactor_class, inputs: inputs, context: context, async: async, process_jobs: process_jobs ) end |