Skip to content

Instantly share code, notes, and snippets.

@dyoder
Created November 9, 2011 20:51
Show Gist options
  • Save dyoder/1352974 to your computer and use it in GitHub Desktop.
Save dyoder/1352974 to your computer and use it in GitHub Desktop.
Chaining tests in cakefiles
_invoke = (task,callback) ->
error = false
run
line: "cake #{task}"
error: (data) -> error = true; sys.print(data)
finished: ->
if callback
console.log "Waiting one second to make sure task '#{task}' has completed"
setTimeout (-> callback() if !error), 1000
[dan@yoda shark (stubby*)]$ cake test
test - run all the shark tests
test:dispatcher - run all the dispatcher specs
build - compile coffee script source files and copy them into lib
Waiting one second to make sure task 'build' has completed
Running on 127.0.0.1, port 1337
Response URL defined as http://localhost:1337/
Checking long-polling ...
√ [Account: creation (POST)] Result: includes an account key
√ [Account: delete (DELETE)] Result: the delete was successful
√ [Account: update (PUT)] Result: returns the updated account
√ [Account: update (PUT)] Result: name is updated
√ [Channel: creation (POST)] Result: includes a URL
√ [Channel: creation (POST)] Result: includes a URL
√ [Channel: delete (DELETE)] Result: the delete was successful
√ [Channel: info (GET)] Result: returns the specified channel
√ [Channel: publishing (POST)] Result: has the content we published
√ [Channel: publishing (POST)] Result: has the content we published
√ [Service: description (GET)] Result: includes an accounts URL
√ [Session: close (DELETE)] Result: the delete was successful
√ [Session: close (DELETE)] Result: the session is no longer valid
√ [Session: creation (POST)] Result: includes a session URL
√ [Session: creation (POST)] Result: includes a channels URL
√ [Session: creation (POST)] Result: includes a session URL
√ [Session: creation (POST)] Result: includes a channels URL
√ [Session: creation (POST)] Result: does not include account info when including only the key
√ [Session: creation (POST)] Result: includes a session URL
√ [Session: creation (POST)] Result: includes a channels URL
√ [Session: creation (POST)] Result: includes account when using email/password
√ [Session: get (GET)] Result: includes a session URL
√ [Session: get (GET)] Result: includes a channels URL
√ [Subscription: creation (POST)] Result: includes a subscription URL
√ [Subscription: listening (GET)] Result: includes a list of messages
√ [Subscription: listening (GET)] Result: includes the message we published
√ [Subscription: listening (GET)] Result: and none that we didn't
√ [Subscription: listening (GET)] Result: includes a list of messages
√ [Subscription: listening (GET)] Result: got message via long-poll
Summary: 29 total, 29 passed, 0 failed
Waiting one second to make sure task 'test:dispatcher' has completed
Running on 127.0.0.1, port 1337
Response URL defined as http://localhost:1337/
√ Discovery
√ Create-An-Account
√ Create-A-Session
√ Create-A-Channel
√ Publish-A-Message
√ Subscribe-To-A-Channel
√ Listen-On-A-Channel
√ Listen-On-A-Channel-For-New-Messages
√ Publish-A-Message
√ Listen-On-A-Channel-Using-Long-Polling
Waiting one second to make sure task 'test:tutorial' has completed
Running on 127.0.0.1, port 1337
Response URL defined as http://localhost:1337/
♢ An HTTP Adapter
a delete request to a resource that doesn't support delete
✓ will return a 405
a simple get request with an accept header
✓ will return a 200 with an appropriate response body
a simple get request without an accept header
✓ will return a 406
a simple post request with an entity body
✓ will return a 201 echoing the entity body
a simple post request with the wrong content type
✓ will return a 415
✓ OK » 5 honored (0.021s)
[dan@yoda shark (stubby*)]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment