Class: DeepTest::UI::Console

Inherits:
Object
  • Object
show all
Defined in:
lib/deep_test/ui/console.rb

Defined Under Namespace

Classes: Spinner

Constant Summary collapse

METHOD_DESCRIPTIONS =
{
  :sync => "Synchronizing working copies on worker machines",
  :spawn_worker_server => "Spawning test environment processes",
  :load_files => "Loading test files for workers",
  :start_all => "Starting workers",
  :stop_all => "Stopping workers"
}

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Console

Returns a new instance of Console.



4
5
# File 'lib/deep_test/ui/console.rb', line 4

def initialize(options)
end

Instance Method Details

#dispatch_finished(method_name) ⇒ Object



34
35
36
37
# File 'lib/deep_test/ui/console.rb', line 34

def dispatch_finished(method_name)
  @spinner.stop if @spinner
  @spinner = nil
end

#dispatch_starting(method_name) ⇒ Object



24
25
26
27
28
# File 'lib/deep_test/ui/console.rb', line 24

def dispatch_starting(method_name)
  @spinner.stop if @spinner
  @spinner = Spinner.new(label(method_name))
  @spinner.start
end

#distributed_failover_to_local(method, exception) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/deep_test/ui/console.rb', line 15

def distributed_failover_to_local(method, exception)
  width = 70
  puts " Distributed DeepTest Failure ".center(width, '*')
  puts "*   Failed during #{method}".ljust(width - 1) + "*"
  puts "* #{exception.message}".ljust(width - 1) + "*"
  puts "* Failing over to local run".ljust(width - 1) + "*"
  puts "*" * width
end

#label(method_name) ⇒ Object



30
31
32
# File 'lib/deep_test/ui/console.rb', line 30

def label(method_name)
  METHOD_DESCRIPTIONS[method_name.to_sym] || method_name.to_s
end