Just decided to get more into testing (i've read it is almost guaranteed my code will improve..). I created a new Dancer2 app. The modules I use are installed locally via a cpanfile and a `carton install` command. Everything works though I cannot get the testing to work as I get warnings like:
Can't locate Dancer2/Plugin/Database.pm in @INC (you may need to insta +ll the Dancer2::Plugin::Database module)
#!/usr/bin/env perl use strict; use warnings; use File::Basename; use File::Spec; use lib File::Spec->catdir( File::Basename::dirname( File::Spec->rel2a +bs($0) ), '..', 'local/lib/perl5' ); use lib File::Spec->catdir( File::Basename::dirname( File::Spec->rel2a +bs($0) ), '..', 'lib' ); use jwsDancer; jwsDancer->to_app;
package jwsDancer; use Dancer2; use Dancer2::Plugin::Database; use Dancer2::FileUtils qw/path read_file_content/; use Cwd qw(abs_path); use lib dirname( dirname abs_path $0) . '/../../lib'; get '/' => sub { template 'index' => { 'title' => 'a web page' }; true;
For now I'm just trying to use the test that is generated by scaffolding a Dancer2 app via
prove -lv t/002_index_route.tCan anyone give a hint what I should do to have the locally installed modules (in local/lib/perl5) work as well in the testing environment?
In reply to Testing a Dancer2 app with locally installed modules by GertMT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |