I,m trying to run a sanity test for my
use Test::More 'no_plan';
use Dancer2::Test app => ['PearlBee'];
use lib 'lib';
# the order is important
use_ok 'Dancer2::Test', app => 'PearlBee';
use_ok 'lib::PearlBee::Model::Schema';# apps => ['PearlBee'];
#my $schema = DBICx::TestDatabase->new('lib::PearlBee::Model::Schema');
my $schematest = Test::DBIx::Class::Schema->new(
dsn => 'dbi:mysql:PearlBee;host=localhost;', # or use schema option
namespace => 'lib::PearlBee::Model::Schema',
moniker => 'user',
username => 'root',
password => '1',
glue => 'Result',
#test_missing => 1,
columns => [
resultsets => [
Can't locate object method "connect" via package "lib::PearlBee::Model::Schema"
These lines look interesting:
use lib 'lib'; use lib::PearlBee::Model::Schema;
The first one seems ok. I can see why you'd want to add 'lib' to
@INC. But having done that, I'd expect the second line to be:
It seems very unlikely that you'd need that
lib:: on the front of the module name. But perhaps your directory structure is more complex that I'm assuming. Where is the PearlBee schema module?
Update: Also note that the latest version of the Dancer2::Test documentation says this:
DEPRECATED. Please use Plack::Test instead as shown in the SYNOPSIS!
This module will warn for a while until we actually remove it. This is to provide enough time to fully remove it from your system.
I suggest you follow that advice.