Module: ConflowSpec::TestFlow Private
- Defined in:
- lib/conflow_spec/test_flow.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Module which, when included, will override logic of queueing jobs.
Class Method Summary collapse
-
.build(flow_class, queue) ⇒ Class
private
Creates new class which behaves like flow_class (class being tested), but with overriden logic of queueing jobs.
-
.prepended(base) ⇒ Object
private
Adds name and queue attributes on test class.
Instance Method Summary collapse
-
#_conflow_spec_returns ⇒ Object
private
Set of return values of jobs.
-
#queue(job) ⇒ Object
private
Queues job pushing it to a Thread::Queue.
Class Method Details
.build(flow_class, queue) ⇒ Class
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates new class which behaves like flow_class (class being tested), but with overriden logic of queueing jobs.
17 18 19 20 21 22 23 |
# File 'lib/conflow_spec/test_flow.rb', line 17 def build(flow_class, queue) Class.new(flow_class).tap do |test_class| test_class.prepend(self) test_class.name = flow_class.name test_class.queue = queue end end |
.prepended(base) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Adds name and queue attributes on test class
26 27 28 29 30 |
# File 'lib/conflow_spec/test_flow.rb', line 26 def prepended(base) base.singleton_class.instance_exec do attr_accessor :name, :queue end end |
Instance Method Details
#_conflow_spec_returns ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Set of return values of jobs
40 41 42 |
# File 'lib/conflow_spec/test_flow.rb', line 40 def _conflow_spec_returns @_conflow_spec_returns ||= Set.new end |
#queue(job) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Queues job pushing it to a Thread::Queue
34 35 36 |
# File 'lib/conflow_spec/test_flow.rb', line 34 def queue(job) self.class.queue << job end |