<commit_before>require_relative 'like_assay'

# EqualAssay coers the assertion comparing two objects with `#==` operator.
#
class EqualAssay < LikeAssay

  register :==, :equal

  #
  # Test assertion of `#==` method.
  #
  def self.pass?(subject, criterion)
    subject == criterion
  end

  #
  # Error message for equal assertion.
  #
  def pass_message(subject)
    a = subject.inspect
    b = criteria.first.inspect
  
    if a.size > SIZE_LIMIT or b.size > SIZE_LIMIT
      if $ansi
        d = ANSI::Diff.new(a, b)
        a, b = d.diff1, d.diff2  # *d.to_a
      end
      "a == b\na) #{a}\nb) #{b}"
    else
      "#{a} == #{b}"
    end
  end

end

<commit_msg>Fix assert_message method for EqualAssay.<commit_after>require_relative 'like_assay'

# EqualAssay coers the assertion comparing two objects with `#==` operator.
#
class EqualAssay < LikeAssay

  register :==, :equal

  #
  # Test assertion of `#==` method.
  #
  def self.pass?(subject, criterion)
    subject == criterion
  end

  #
  # Error message for equal assertion.
  #
  def self.assert_message(subject, criterion)
    a = subject.inspect
    b = criterion.inspect
  
    if a.size > SIZE_LIMIT or b.size > SIZE_LIMIT
      if $ansi
        d = ANSI::Diff.new(a, b)
        a, b = d.diff1, d.diff2  # *d.to_a
      end
      "a == b\na) #{a}\nb) #{b}"
    else
      "#{a} == #{b}"
    end
  end

end


{'fraction_non_alphanumeric': 0.13178855901520636, 'fraction_numerical': 0.002896451846488052, 'mean_word_length': 2.4463840399002494, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '322926', 'n_tokens_mistral': 530, 'n_tokens_neox': 501, 'n_words': 133}