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



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

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

Instance Method Details

#option(name, value = nil) ⇒ Object



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

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

#runObject



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

def run
				puts "Running #{self.to_s} with DISPLAY=#{ENV['DISPLAY']}"
  system(self.to_s)
end

#to_sObject



226
227
228
# File 'lib/js_test_driver/runner.rb', line 226

def to_s
  return @command
end