Class: Terrapin::CommandLine::FakeRunner
- Inherits:
-
Object
- Object
- Terrapin::CommandLine::FakeRunner
- Defined in:
- lib/terrapin/command_line/runners/fake_runner.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
Class Method Summary collapse
Instance Method Summary collapse
- #call(command, env = {}, options = {}) ⇒ Object
-
#initialize ⇒ FakeRunner
constructor
A new instance of FakeRunner.
- #ran?(predicate_command) ⇒ Boolean
- #supported? ⇒ Boolean
Constructor Details
#initialize ⇒ FakeRunner
Returns a new instance of FakeRunner.
16 17 18 |
# File 'lib/terrapin/command_line/runners/fake_runner.rb', line 16 def initialize @commands = [] end |
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
14 15 16 |
# File 'lib/terrapin/command_line/runners/fake_runner.rb', line 14 def commands @commands end |
Class Method Details
.supported? ⇒ Boolean
6 7 8 |
# File 'lib/terrapin/command_line/runners/fake_runner.rb', line 6 def self.supported? false end |
Instance Method Details
#call(command, env = {}, options = {}) ⇒ Object
20 21 22 23 |
# File 'lib/terrapin/command_line/runners/fake_runner.rb', line 20 def call(command, env = {}, = {}) commands << [command, env] Output.new("") end |
#ran?(predicate_command) ⇒ Boolean
25 26 27 |
# File 'lib/terrapin/command_line/runners/fake_runner.rb', line 25 def ran?(predicate_command) @commands.any?{|(command, _)| command =~ Regexp.new(predicate_command) } end |
#supported? ⇒ Boolean
10 11 12 |
# File 'lib/terrapin/command_line/runners/fake_runner.rb', line 10 def supported? self.class.supported? end |