Skip to content

Instantly share code, notes, and snippets.

@timbertson
Created March 29, 2010 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timbertson/347453 to your computer and use it in GitHub Desktop.
Save timbertson/347453 to your computer and use it in GitHub Desktop.
$ bin/cake test -f operations
passed 3 tests in 0.01 seconds
# verbose test listing
$ bin/cake test -vf operations
test/test_operations.coffee:
- operations should be chainable ... ok
- operations should only evaluate arguments once ... ok
- operations should treat =, == and `is` uniformly ... ok
passed 3 tests in 0.01 seconds
# failing test
$ bin/cake test -vf operations
test/test_operations.coffee:
- operations should be chainable ... ok
- operations should only evaluate arguments once ... ok
- operations should treat =, == and `is` uniformly ... failed
-------------------------
FAILED: operations should treat =, == and `is` uniformly
AssertionError: true == false
at eval at <anonymous> (lib/coffee-script.js:58:25)
at run_tests (lib/spec.js:71:9)
at run_file (lib/spec.js:103:12)
at iterate (lib/spec.js:163:50)
at iterate (lib/spec.js:157:18)
at iterate (lib/spec.js:157:18)
at iterate (lib/spec.js:157:18)
at iterate (lib/spec.js:157:18)
at iterate (lib/spec.js:157:18)
at iterate (lib/spec.js:157:18)
failed 1 and passed 2 tests in 0.01 seconds
# non-verbose, failure
$ bin/cake test -f operations
-------------------------
FAILED: operations should treat =, == and `is` uniformly
AssertionError: true == false
at eval at <anonymous> (lib/coffee-script.js:58:25)
at run_tests (lib/spec.js:71:9)
at run_file (lib/spec.js:103:12)
at iterate (lib/spec.js:163:50)
at iterate (lib/spec.js:157:18)
at iterate (lib/spec.js:157:18)
at iterate (lib/spec.js:157:18)
at iterate (lib/spec.js:157:18)
at iterate (lib/spec.js:157:18)
at iterate (lib/spec.js:157:18)
failed 1 and passed 2 tests in 0.01 seconds
describe 'operations', ->
it 'should be chainable', ->
ok 500 > 50 > 5 > -5
ok true is not false is true is not false
ok 0 is 0 isnt 50 is 50
ok 10 < 20 > 10
ok 50 > 10 > 5 is parseInt('5', 10)
it 'should only evaluate arguments once', ->
i: 0
func: -> i++
ok 1 > func() < 1
it 'should treat =, == and `is` uniformly', ->
a: 1
b: 1
ok a is 1 and b is 1
ok a == b
ok a is b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment