Class: Buffet::Runner

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

Instance Method Summary collapse

Constructor Details

#initializeRunner

Returns a new instance of Runner.



6
7
8
# File 'lib/buffet/runner.rb', line 6

def initialize
  @project = Settings.project
end

Instance Method Details

#example_failedObject



37
38
39
40
# File 'lib/buffet/runner.rb', line 37

def example_failed
  print 'F'.red
  STDOUT.flush
end

#example_passedObject



32
33
34
35
# File 'lib/buffet/runner.rb', line 32

def example_passed
  print '.'.green
  STDOUT.flush
end

#example_pendingObject



42
43
44
45
# File 'lib/buffet/runner.rb', line 42

def example_pending
  print '*'.yellow
  STDOUT.flush
end

#failures?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/buffet/runner.rb', line 51

def failures?
  @master.failures.any?
end

#run(specs = nil) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/buffet/runner.rb', line 10

def run specs = nil
  @specs = specs
  raise 'No specs found' if @specs.empty?

  @slaves = Settings.slaves
  raise 'No slaves defined in settings.yml' if @slaves.empty?

  Buffet.logger.info "Starting Buffet test run"
  puts "Running Buffet..."

  run_tests
  display_results
end

#slave_finished(slave) ⇒ Object



47
48
49
# File 'lib/buffet/runner.rb', line 47

def slave_finished slave
  Buffet.logger.info "#{slave.name} finished"
end

#slave_prepared(slave) ⇒ Object



24
25
26
# File 'lib/buffet/runner.rb', line 24

def slave_prepared slave
  Buffet.logger.info "#{slave.name} prepared"
end

#spec_taken(slave, spec_file) ⇒ Object



28
29
30
# File 'lib/buffet/runner.rb', line 28

def spec_taken slave, spec_file
  Buffet.logger.info "#{slave.name} took #{spec_file}"
end