What can I do for Makefile.PL, so when I run make test, it runs a test suite with the dancer environment set to 'test'?

I would like to be able to simply type "make test" in the appplevel source directory for the dancer application (the one that was generated by "dancer -a appname") and run it using the environment set to "test".

Or, if someone can point me to a repository, which I can call a kind of β€œbest practice for developing an application for dancers,” that would be great!

+7
source share
2 answers

I did some checking and found the following thread on the dancer user mailing list:

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

In a nutshell; The test files include:

use Dancer::Test; Dancer::set environment => 'testing'; Dancer::Config->load; 

Do not execute:

 use Dancer; 

I have not tested this; but the user from the message claims that he worked for them ....

0
source

You can modify the makefile to set the DANCER_ENVIRONMENT variable accordingly.

If I had my druthers, just using Dancer :: Test would automatically set up the environment.

0
source

All Articles