Module: Minitest::HashDiffAssertions

Defined in:
lib/minitest/hashdiff.rb

Overview

Prepended so assert_equal failures on two hashes show the readable report instead of the default diff.

Instance Method Summary collapse

Instance Method Details

#diff(exp, act) ⇒ Object



72
73
74
75
76
77
78
# File 'lib/minitest/hashdiff.rb', line 72

def diff(exp, act)
  if exp.is_a?(Hash) && act.is_a?(Hash) && exp != act
    Minitest::HashDiff.format(exp, act) || super
  else
    super
  end
end