Class: TestSystemRunner
- Inherits:
-
Object
- Object
- TestSystemRunner
- Defined in:
- lib/adx_toolkit/system_runner.rb
Overview
System runner test double
Instance Attribute Summary collapse
-
#is_running ⇒ Object
readonly
Returns the value of attribute is_running.
Instance Method Summary collapse
-
#initialize ⇒ TestSystemRunner
constructor
A new instance of TestSystemRunner.
- #print_log ⇒ Object
- #run(command) ⇒ Object
- #run_with_output(command) ⇒ Object
- #running?(command) ⇒ Boolean
- #running_sequence?(*commands) ⇒ Boolean
Constructor Details
#initialize ⇒ TestSystemRunner
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_running ⇒ Object (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
#print_log ⇒ Object
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
37 38 39 |
# File 'lib/adx_toolkit/system_runner.rb', line 37 def running?(command) @log.include?(command) end |
#running_sequence?(*commands) ⇒ Boolean
41 42 43 |
# File 'lib/adx_toolkit/system_runner.rb', line 41 def running_sequence?(*commands) @log == commands end |