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-02 years ago50 downloads
0.3.3-02 years ago8 downloads
0.3.2-02 years ago7 downloads
0.3.1-02 years ago7 downloads
0.3.0-02 years ago7 downloads
0.2.0-02 years ago(revision: 2)16 downloads
0.1.3-02 years ago24 downloads
0.1.2-02 years ago33 downloads
0.1.1-02 years ago6 downloads
0.1.0-02 years ago9 downloads

Dependencies

Manifests