Class: Cocaine::CommandLine::FakeRunner
- Inherits:
-
Object
- Object
- Cocaine::CommandLine::FakeRunner
- Defined in:
- lib/cocaine/command_line/runners/fake_runner.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
Instance Method Summary collapse
- #call(command, env = {}) ⇒ Object
-
#initialize ⇒ FakeRunner
constructor
A new instance of FakeRunner.
- #ran?(predicate_command) ⇒ Boolean
Constructor Details
#initialize ⇒ FakeRunner
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
#commands ⇒ Object (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
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 |