Method: TestML::Runtime::Unit#assert_EQ

Defined in:
lib/testml/runtime/unit.rb

#assert_EQ(got, want) ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/testml/runtime/unit.rb', line 60

def assert_EQ(got, want)
  got = got.value
  want = want.value
  # TODO Move this logic to testml/diff
  if got != want
    if want.match /\n/
      File.open('/tmp/got', 'w') {|f| f.write got}
      File.open('/tmp/want', 'w') {|f| f.write want}
      STDERR.write(`diff -u /tmp/want /tmp/got`)
    end
  end
  testcase.assert_equal want, got, get_label
end