Class: JsTestDriver::Runner::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/js_test_driver/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(executable) ⇒ Command

Returns a new instance of Command.



206
207
208
# File 'lib/js_test_driver/runner.rb', line 206

def initialize(executable)
  @command = "#{executable}"
end

Instance Method Details

#option(name, value = nil) ⇒ Object



210
211
212
213
214
# File 'lib/js_test_driver/runner.rb', line 210

def option(name, value = nil)
  value = "'#{value}'" if value && value =~ /\s/
  @command = [@command, name, value].compact.join(' ')
  self
end

#runObject



216
217
218
# File 'lib/js_test_driver/runner.rb', line 216

def run
  system(self.to_s)
end

#to_sObject



220
221
222
# File 'lib/js_test_driver/runner.rb', line 220

def to_s
  return @command
end