class MiniSpec::PrettyPrint

Public Instance Methods

text(str, width = str.length) click to toggle source
Calls superclass method
# File lib/minispec/utils/pretty_print.rb, line 36
def text str, width = str.length
  if str.include?("\e[")
    super "%s\e[0m" % str, width
  elsif str.start_with?('#<') || str == '=' || str == '>'
    super highlight_object_literal(str), width
  else
    super CodeRay.scan(str, :ruby).term, width
  end
end

Private Instance Methods

highlight_object_literal(object_literal) click to toggle source
# File lib/minispec/utils/pretty_print.rb, line 47
def highlight_object_literal object_literal
  "\e[32m%s\e[0m" % object_literal
end