class SuperDiff::EqualityMatchers::Hash

Public Class Methods

applies_to?(value) click to toggle source
# File lib/super_diff/equality_matchers/hash.rb, line 4
def self.applies_to?(value)
  value.class == ::Hash
end

Public Instance Methods

fail() click to toggle source
# File lib/super_diff/equality_matchers/hash.rb, line 8
      def fail
        <<~OUTPUT.strip
          Differing hashes.

          #{
            Helpers.style(
              :expected,
              "Expected: " +
              SuperDiff.inspect_object(expected, as_lines: false),
            )
          }
          #{
            Helpers.style(
              :actual,
              "  Actual: " +
              SuperDiff.inspect_object(actual, as_lines: false),
            )
          }

          Diff:

          #{diff}
        OUTPUT
      end

Protected Instance Methods

diff() click to toggle source
# File lib/super_diff/equality_matchers/hash.rb, line 35
def diff
  Differs::Hash.call(expected, actual, indent_level: 0)
end