Class: TestSystemRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/adx_toolkit/system_runner.rb

Overview

System runner test double

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTestSystemRunner

Returns a new instance of TestSystemRunner.



23
24
25
# File 'lib/adx_toolkit/system_runner.rb', line 23

def initialize
  @log = []
end

Instance Attribute Details

#is_runningObject (readonly)

Returns the value of attribute is_running.



21
22
23
# File 'lib/adx_toolkit/system_runner.rb', line 21

def is_running
  @is_running
end

Instance Method Details



45
46
47
# File 'lib/adx_toolkit/system_runner.rb', line 45

def print_log
  p @log
end

#run(command) ⇒ Object



27
28
29
30
# File 'lib/adx_toolkit/system_runner.rb', line 27

def run(command)
  @log.append(command)
  @is_running = true
end

#run_with_output(command) ⇒ Object



32
33
34
35
# File 'lib/adx_toolkit/system_runner.rb', line 32

def run_with_output(command)
  @log.append(command)
  @is_running = true
end

#running?(command) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/adx_toolkit/system_runner.rb', line 37

def running?(command)
  @log.include?(command)
end

#running_sequence?(*commands) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/adx_toolkit/system_runner.rb', line 41

def running_sequence?(*commands)
  @log == commands
end