Skip to content

Commit

Permalink
Failed assertions no longer repeat message.
Browse files Browse the repository at this point in the history
Failed assertions no longer repeat the assertion message as a comment. In my
Node.js `assert` module function wrappers, I was printing the assertion message
passed into the assertion function as the assertion message. To be thorough, I
printed the assertion message of the caught `AssertionError` as a comment.
However, the `AssertionError` message is, of course, the same as the message
passed into the assertion, the assertion message. It was redundant. It is no
more.

Updated `vendor/twinkie` to support upstream changes made for CoffeeScript
1.3.1.
  • Loading branch information
flatheadmill committed Apr 30, 2012
1 parent 7f808a0 commit 0c37060
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/lib/proof.coffee
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ for name, assertion of require("assert")
assertion.apply @, splat assertion.apply @, splat
process.stdout.write "ok #{++@_actual} #{message}\n" process.stdout.write "ok #{++@_actual} #{message}\n"
catch e catch e
process.stdout.write "not ok #{++@_actual} #{message} # #{e.message}\n" # Recall that the assertion message is the same as the assertion
# exception message.
process.stdout.write "not ok #{++@_actual} #{e.message}\n"
EXPECTED = if name is "ok" then true else splat[1] EXPECTED = if name is "ok" then true else splat[1]
inspect = { EXPECTED, GOT: splat[0] } inspect = { EXPECTED, GOT: splat[0] }
inspect = require("util").inspect inspect, null, Math.MAX_VALUE inspect = require("util").inspect inspect, null, Math.MAX_VALUE
Expand Down
2 changes: 1 addition & 1 deletion vendor/twinkie
Submodule twinkie updated from fc6748 to b92a74

0 comments on commit 0c37060

Please sign in to comment.