class SuperDiff::RSpec::MatcherTextTemplate::ColorizedList

Attributes

color[R]

Public Class Methods

new(color, *args, &block) click to toggle source
# File lib/super_diff/rspec/matcher_text_template.rb, line 171
def initialize(color, *args, &block)
  super(*args, &block)

  @color = color
end

Public Instance Methods

to_s() click to toggle source
# File lib/super_diff/rspec/matcher_text_template.rb, line 177
def to_s
  to_sentence(colorized_values)
end

Private Instance Methods

colorized_values() click to toggle source
# File lib/super_diff/rspec/matcher_text_template.rb, line 185
def colorized_values
  evaluate.map do |value|
    colorizer.wrap(
      ::RSpec::Support::ObjectFormatter.format(value),
      color,
    )
  end
end
colorizer() click to toggle source
# File lib/super_diff/rspec/matcher_text_template.rb, line 194
def colorizer
  ::RSpec::Core::Formatters::ConsoleCodes
end