Module: ObjectComparator::Minitest

Defined in:
lib/object_comparator/minitest.rb

Instance Method Summary collapse

Instance Method Details

#assert_equal_objects(expected, actual, message = nil) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/object_comparator/minitest.rb', line 5

def assert_equal_objects(expected, actual, message = nil)
  expected = InspectionString.new(expected.inspect)
  actual = InspectionString.new(actual.inspect)

  message ||= ObjectComparator.new.failing_message_for_should(expected, actual)

  assert_equal(expected, actual, message)
end

#refute_equal_objects(expected, actual, message = nil) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/object_comparator/minitest.rb', line 14

def refute_equal_objects(expected, actual, message = nil)
  expected = InspectionString.new(expected.inspect)
  actual = InspectionString.new(actual.inspect)

  message ||= ObjectComparator.new.failing_message_for_should_not(expected, actual)

  refute_equal(expected, actual, message)
end