lua-resty-busted2

better openresty busted test unit framework

$ luarocks install lua-resty-busted2

## ngx.log
The ngx.log output can now be inspected.
```lua
it('DEBUG', function()
ngx.log(ngx.DEBUG, '1')
assert.error_log('1', ngx.DEBUG)
end)
```
`Notice`:
1. `CRIT`,`ALERT`,`EMERG` will throw error
2. `STDERR` will just output to std err
### When to clear the log
start a new `describe`,`context`,`file`,`suite` test.
If you want to clean up in every test.
```lua
context('every test clear log', function()
busted_ngx.each_test_clean_log()
ngx.log(ngx.ERR, '1')
it('1', function()
assert.no.error_log()
end)
it('2', function()
assert.no.error_log('1')
ngx.log(ngx.ERR, '2')
assert.error_log('2')
end)
end)
```

Versions

0.3.4-01 year ago38 downloads
0.3.3-01 year ago6 downloads
0.3.2-01 year ago5 downloads
0.3.1-01 year ago5 downloads
0.3.0-01 year ago5 downloads
0.2.0-01 year ago(revision: 2)14 downloads
0.1.3-01 year ago22 downloads
0.1.2-01 year ago31 downloads
0.1.1-01 year ago4 downloads
0.1.0-01 year ago7 downloads

Dependencies

Manifests