Colorize matcher values green and red

This commit is contained in:
Michael Miller 2019-03-03 10:26:03 -07:00
parent df71e56b3e
commit 6307024af3
1 changed files with 6 additions and 2 deletions

View File

@ -65,8 +65,12 @@ module Spectator::Formatting
# Produces the values list for an expectation # Produces the values list for an expectation
private def matcher_values(indent, expectation) private def matcher_values(indent, expectation)
MatchDataValues.new(expectation.values).each do |pair| MatchDataValues.new(expectation.values).each do |pair|
# TODO: Not all expectations will be failures (color green and red). colored_pair = if expectation.satisfied?
indent.line(Color.failure(pair)) Color.success(pair)
else
Color.failure(pair)
end
indent.line(colored_pair)
end end
end end