I am trying to write test code for Lua scripts that are run I Nginx via `init_by_lua_file`
The script file I am testing reads a bunch of values, like `ngx.req.get_headers()["User-Agent"], and returns a result based on their combination.
To set up testing I wrote a `busted` test file executed via `resty` CLI that attempts to set the headers and get the results from my script's function:
```
describe("Initilization code", function()
describe("block some things", function()
it("should block some request", function()
ngx.header["User-Agent"] = "Mozilla/5.0"
```
When I run this code via `resty` I get the following error:
`API disabled in the current context` on the `ngx.header["User-Agent"] = "Mozilla/5.0"` line
I am completely new to Nginx, Lua and Busted so it's kind of difficult to figure this out. Can I even run these tests using Busted? Or do I need to use the OpenResty Perl framework?
If I am on the right track how do I switch context to (I assume) `init_by_lua_file`?
Thanks!