Module: Nicetest::SuperdiffPlugin

Defined in:
lib/minitest/superdiff_plugin.rb

Defined Under Namespace

Modules: Helpers Classes: AssertIncludesMessage

Instance Method Summary collapse

Instance Method Details

#assert_includes(collection, item, message = nil) ⇒ Object



39
40
41
42
43
44
45
46
47
# File 'lib/minitest/superdiff_plugin.rb', line 39

def assert_includes(collection, item, message = nil)
  super
rescue Minitest::Assertion => e
  raise if message

  exception = Minitest::Assertion.new(AssertIncludesMessage.new(collection: collection, item: item))
  exception.set_backtrace(e.backtrace)
  raise exception
end

#diff(expected, actual) ⇒ Object



31
32
33
# File 'lib/minitest/superdiff_plugin.rb', line 31

def diff(expected, actual)
  SuperDiff::EqualityMatchers::Main.call(expected: expected, actual: actual)
end

#mu_pp(obj) ⇒ Object



35
36
37
# File 'lib/minitest/superdiff_plugin.rb', line 35

def mu_pp(obj)
  SuperDiff.inspect_object(obj, as_lines: false)
end