Class: Spassky::Client::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/spassky/client/cli.rb

Constant Summary collapse

DEFAULT_PORT =
"9191"
DEFAULT_SERVER =
"http://localhost:#{DEFAULT_PORT}"

Instance Method Summary collapse

Instance Method Details

#devices(server = DEFAULT_SERVER) ⇒ Object



21
22
23
24
25
26
# File 'lib/spassky/client/cli.rb', line 21

def devices(server = DEFAULT_SERVER)
  Spassky::Client::DeviceListRetriever.new(server).get_connected_devices.each do |device|
    puts device
  end
  nil
end

#run(pattern, test, server = DEFAULT_SERVER, colour = FALSE) ⇒ Object



14
15
16
17
18
19
# File 'lib/spassky/client/cli.rb', line 14

def run(pattern, test, server = DEFAULT_SERVER, colour = FALSE)
  writer = colour ? ColouredWriter : DefaultWriter
  pusher = Pusher.new(server)
  test_suite_runner = TestSuiteRunner.new(pusher, writer.new(STDOUT), DirectoryReader.new(pattern))
  test_suite_runner.run_test_suite(pattern, test)
end

#server(port = DEFAULT_PORT) ⇒ Object



28
29
30
31
# File 'lib/spassky/client/cli.rb', line 28

def server(port = DEFAULT_PORT)
  Spassky::Server::App.set :port, port
  Spassky::Server::App.run!
end