Skip to content

Instantly share code, notes, and snippets.

@rymizuki
Created April 3, 2014 22:46
Show Gist options
  • Save rymizuki/9964411 to your computer and use it in GitHub Desktop.
Save rymizuki/9964411 to your computer and use it in GitHub Desktop.
config
.request [
{id: 1, method: "GET", path: "/admin/reset", params: {}}
]
.test [
{id: 1, to_be: [{code: 204}]}
]
.calcurator
success: 10
failed: -10
not_implemented: 0
request: (spec) ->
method = spec.req.method
path = spec.req.path
params = spec.req.params
new Client({scheme: @schema, host: @host, port: @port})
.on "start", @benchmark.start
.on "start", @calcurator.start
.on "start", @test.start
.on "finish", @benchmark.resolve
.on "finish", @calcurator.resolve
.on "finish", @test.resolve
.request method, path, params
execute: () ->
tasks = @specs.map @request
async.parallel tasks, @finish;
finish: (err, results) ->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment