in reply to in-memory database, testing modules using DBIx::Class models
Found a solution that works for me:
package TestModules; use MyApp::Schema; MyApp::Schema->connection( 'dbi:SQLite:dbname=:memory:', '', '' ); MyApp::Schema->load_namespaces; MyApp::Schema->deploy; # set data MyApp::Schema->resultset('TestModule')->create({ id => 1, name => 'Test', }); 1;
So, just load this module before tests (on using modules that query DBIx::Class models) and it works.
|
|---|