Class: Terrapin::CommandLine::FakeRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/terrapin/command_line/runners/fake_runner.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFakeRunner

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

#commandsObject (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

Returns:

  • (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 = {}, options = {})
  commands << [command, env]
  Output.new("")
end

#ran?(predicate_command) ⇒ Boolean

Returns:

  • (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

Returns:

  • (Boolean)

10
11
12
# File 'lib/terrapin/command_line/runners/fake_runner.rb', line 10

def supported?
  self.class.supported?
end