29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/Bacon_Colored.rb', line 29
def handle_summary
specs, reqs, fails, errs = Counter.values_at(:specifications, :requirements, :failed, :errors)
all_pass = reqs > 1 && (fails == errs) && (errs == 0)
single_pass = reqs == 1 && specs == 1 && (errs == 0) && (fails == errs)
print ErrorLog if Backtraces
print "%d specifications (%d requirements)".send(all_pass ? :green : :to_s ) % [ specs, reqs ]
if single_pass
print( ". Just one requirement and it passes. ".green )
elsif all_pass
print( ". All pass. ".green )
else
print ", "
print "#{fails} failures".send( fails > 0 ? :red : :to_s )
print ", "
print "#{errs} errors".send( errs > 0 ? :yellow : :to_s )
print ". "
end
puts
puts
end
|