春哥你好! 我是 test-nginx 使用新手,我在写 --http_config 的时候里面的内容比较多,比如有各种 lua_shared_dict,请问我可以把这里面的内容单独放在一个新的文件中,像include一样把它包含起来吗?
还有同一个t文件夹下是不是只能有一个.t 文件?
谢谢! --
2016-08-08 15:26 GMT+08:00 Juntong Fu <fujt...@gmail.com>:春哥你好! 我是 test-nginx 使用新手,我在写 --http_config 的时候里面的内容比较多,比如有各种 lua_shared_dict,请问我可以把这里面的内容单独放在一个新的文件中,像include一样把它包含起来吗?这是春哥前两天回复的邮件,你可以参考一下:或许你可以用 nginx 的 include 指令来加载核心的 nginx 配置?比如 === TEST 1: App --- config include ../../../conf/app-core.conf; --- request GET /t --- response_body hello world --- no_error_log [error]假设你的项目目录结构是这样的: t/ └── a.t conf/ └── app-core.confnginx.conf 的 boilter-plate 由 Test::Nginx 来自动生成是必要的,否则我们无法实现这里列举的Test::Nginx 的各种高级测试模式: https://openresty.gitbooks.io/programming-openresty/content/testing/test-modes.html 还有同一个t文件夹下是不是只能有一个.t 文件?看下面截图,相信你能找到答案了。 谢谢! -- -- YuanSheng Wang---------------------------------------My Github: https://github.com/membphisOpenResty lover ^_^