lib/spectus/result/pass.rb in spectus-2.5.0 vs lib/spectus/result/pass.rb in spectus-2.6.0
- old
+ new
@@ -18,15 +18,17 @@
true
end
# Identify the state of the result.
#
+ # @param color [Boolean] Enable the color.
+ #
# @return [String] The char that identify the state of the result.
- def to_char
+ def to_char(color = false)
if got
- '.'
+ color ? "\e[32m.\e[0m" : '.'
else
- 'I'
+ color ? "\e[33mI\e[0m" : 'I'
end
end
end
end
end