class SuperDiff::RSpec::MatcherTextBuilders::Base

Attributes

actual[R]
expected_action_for_description[R]
expected_action_for_failure_message[R]
expected_for_description[R]
expected_for_failure_message[R]
template[R]

Public Class Methods

new( actual:, expected_for_failure_message:, expected_for_description:, expected_action_for_failure_message:, expected_action_for_description: ) click to toggle source
# File lib/super_diff/rspec/matcher_text_builders/base.rb, line 5
def initialize(
  actual:,
  expected_for_failure_message:,
  expected_for_description:,
  expected_action_for_failure_message:,
  expected_action_for_description:
)
  @actual = actual
  @expected_for_failure_message = expected_for_failure_message
  @expected_for_description = expected_for_description
  @expected_action_for_failure_message =
    expected_action_for_failure_message
  @expected_action_for_description = expected_action_for_description

  @negated = nil
  @template = MatcherTextTemplate.new
end

Public Instance Methods

call(negated:) click to toggle source
# File lib/super_diff/rspec/matcher_text_builders/base.rb, line 23
def call(negated:)
  @negated = negated

  fill_template
  template.to_s
end
matcher_description() click to toggle source
# File lib/super_diff/rspec/matcher_text_builders/base.rb, line 30
def matcher_description
  template = MatcherTextTemplate.new do |t|
    t.add_text expected_action_for_description
    add_expected_value_to_description(t)
    add_extra_after_expected_to(t)
  end

  Csi.decolorize(template.to_s(as_single_line: true))
end

Protected Instance Methods

actual_color() click to toggle source
# File lib/super_diff/rspec/matcher_text_builders/base.rb, line 48
def actual_color
  SuperDiff.configuration.actual_color
end
add_extra_after_error() click to toggle source
# File lib/super_diff/rspec/matcher_text_builders/base.rb, line 45
def add_extra_after_error
end
add_extra_after_expected_to(template) click to toggle source
# File lib/super_diff/rspec/matcher_text_builders/base.rb, line 42
def add_extra_after_expected_to(template)
end
expected_color() click to toggle source
# File lib/super_diff/rspec/matcher_text_builders/base.rb, line 52
def expected_color
  SuperDiff.configuration.expected_color
end