我可以对Makefile.PL做什么,这样当我运行make test时,运行测试套件,将舞者环境设置为'test'?

hol*_*eek 7 perl dancer

我希望能够在舞者应用程序中输入"make test"来解决源目录(由"舞者-a appname"生成的目录)并让它在环境设置为'test'的情况下运行测试.

或者,如果有人可以指向我的存储库,我可以称之为"开发舞者应用程序的最佳实践",这将是伟大的!

小智 0

我做了一些检查,在舞者用户邮件列表中发现了以下线程:

http://lists.perldancer.org/pipermail/dancer-users/2011-March/001277.html

简而言之; 在您的测试文件中包括:

use Dancer::Test;
Dancer::set environment => 'testing';
Dancer::Config->load;
Run Code Online (Sandbox Code Playgroud)

不要这样做:

use Dancer;
Run Code Online (Sandbox Code Playgroud)

不过我还没有测试过;但帖子中的用户表示这对他们有用......