Olivine-Labs/busted — pull request #98 by lipp (2013-01-15 12:20:44+00:00)
Title: Async test support

# Changes

## Allow async tests

Specifying `before_each`,`after_each`,`setup`,`teardown` and `it` to run async:

```lua
local ev = require'ev'
local timer = function(on_timeout)
ev.Timer.new(function()
on_timeout()
end,0.01):start(ev.Loop.default)
end

describe('Some async stuff'',function()
before(async,function(done)
timer(done)
end)
x
it('make some async test',async,function(done)
timer(function()
assert.is_true(true)
done()
end)
end)
end)

return 'ev'
```
At the moment lua-ev and copas are supported.

## Auto tag "pending"

The `pending` call is still provided, but test without assertions are automatically tagged as "pending":

```lua
describe('Some stuff'',function()
it('this will be tagged pending',function()
end)
end)
```

## asserts dont "throw" errors

Assertions do not stop execution when failing. Only uncaught errors quit test execution.

## More tests

Checkout https://github.com/lipp/busted/blob/async-test-support/spec/execution_order_ev_spec.lua and other newly added specs.

# Implementation Notes

- `init.lua` and `core.lua` have been deleted and replaced by `busted.lua`.
- Interface to `busted_boostrap` has minor changes.
- Interface to output modules' `header` and `footer` method have changes