19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/testowl/tester.rb', line 19
def run
test_count = 0
fail_count = 0
seconds = 0
files_run = []
begin
@files_list.each do |files|
puts "Running #{files.inspect}"
files_run += files
result = @runner.run(files)
test_count += result[0]
fail_count += result[1]
seconds += result[2]
break if fail_count > 0
end
if @files_list.empty?
puts "No tests found"
elsif test_count == 0
Growl.grr "Empty Test", "No tests run", seconds, :error, files_run, @reason, identifier
return false
elsif fail_count > 0
Growl.grr "Fail", "#{fail_count} out of #{test_count} test#{'s' if test_count > 1} failed :(", seconds, :failed, files_run, @reason, identifier
return false
else
Growl.grr "Pass", "All #{test_count} example#{'s' if test_count > 1} passed :)", seconds, :success, files_run, @reason, identifier
return true
end
rescue => exc
Growl.grr "Exception", exc.message, nil, :error, files_run, @reason, identifier
end
end
|