Class: Cocaine::CommandLine::FakeRunner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFakeRunner

Returns a new instance of FakeRunner.



7
8
9
# File 'lib/cocaine/command_line/runners/fake_runner.rb', line 7

def initialize
  @commands = []
end

Instance Attribute Details

#commandsObject (readonly)

Returns the value of attribute commands.



5
6
7
# File 'lib/cocaine/command_line/runners/fake_runner.rb', line 5

def commands
  @commands
end

Instance Method Details

#call(command, env = {}) ⇒ Object



11
12
13
14
# File 'lib/cocaine/command_line/runners/fake_runner.rb', line 11

def call(command, env = {})
  commands << [command, env]
  ""
end

#ran?(predicate_command) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/cocaine/command_line/runners/fake_runner.rb', line 16

def ran?(predicate_command)
  @commands.any?{|(command, env)| command =~ Regexp.new(predicate_command) }
end