Hello!
2016-06-21 20:05 GMT-07:00 Vurt:
> 想要测试init_worker_by_lua_file和content_by_lua_file中加载的脚本的单元测试,发现通过prove启动测试之后错误日志中报无法找到文件,看Test::Ngnix文档中好像没有找到配置nginx
> -p参数的方法。翻了一下openresty提供的模块中单元测试的例子,找到了这样的写法,但是依然报找不到脚本
>
> use Cwd qw(cwd);
> my $pwd = cwd();
>
> --- http_config
> lua_package_path "$pwd/lib/?.lua;;";
> --- config
> location = /t {
> content_by_lua_file mymodule/xx.lua;
> }
>
你看看 lua-resty-lrucache 库的测试文件是怎么编写的吧!你这里明显抄错了啊。
Regards,
-agentzh