Class: Dynflow::Testing::DummyWorld

Inherits:
Object
  • Object
show all
Extended by:
Mimic
Defined in:
lib/dynflow/testing/dummy_world.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mimic

mimic!

Constructor Details

#initializeDummyWorld

Returns a new instance of DummyWorld.



10
11
12
13
14
15
# File 'lib/dynflow/testing/dummy_world.rb', line 10

def initialize
  @logger_adapter = Testing.logger_adapter
  @clock          = ManagedClock.new
  @executor       = DummyExecutor.new(self)
  @middleware     = Middleware::World.new
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



8
9
10
# File 'lib/dynflow/testing/dummy_world.rb', line 8

def action
  @action
end

#clockObject (readonly)

Returns the value of attribute clock.



7
8
9
# File 'lib/dynflow/testing/dummy_world.rb', line 7

def clock
  @clock
end

#executorObject (readonly)

Returns the value of attribute executor.



7
8
9
# File 'lib/dynflow/testing/dummy_world.rb', line 7

def executor
  @executor
end

#middlewareObject (readonly)

Returns the value of attribute middleware.



7
8
9
# File 'lib/dynflow/testing/dummy_world.rb', line 7

def middleware
  @middleware
end

Instance Method Details

#action_loggerObject



17
18
19
# File 'lib/dynflow/testing/dummy_world.rb', line 17

def action_logger
  @logger_adapter.action_logger
end

#event(execution_plan_id, step_id, event, future = Future.new) ⇒ Object



33
34
35
# File 'lib/dynflow/testing/dummy_world.rb', line 33

def event(execution_plan_id, step_id, event, future = Future.new)
  executor.event execution_plan_id, step_id, event, future
end

#loggerObject



21
22
23
# File 'lib/dynflow/testing/dummy_world.rb', line 21

def logger
  @logger_adapter.dynflow_logger
end

#persistenceObject



37
38
39
# File 'lib/dynflow/testing/dummy_world.rb', line 37

def persistence
  nil
end

#silence_logger!Object



25
26
27
# File 'lib/dynflow/testing/dummy_world.rb', line 25

def silence_logger!
  action_logger.level = 4
end

#subscribed_actions(klass) ⇒ Object



29
30
31
# File 'lib/dynflow/testing/dummy_world.rb', line 29

def subscribed_actions(klass)
  []
end