1 package Reaction::Test::WithDB;
3 use base qw/Reaction::Test/;
7 isa => 'DBIx::Class::Schema', is => 'rw',
8 set_or_lazy_build('schema')
11 has 'schema_class' => (
12 isa => 'Str', is => 'rw', set_or_lazy_fail('schema_class')
15 has 'connect_info' => (
16 isa => 'ArrayRef', is => 'rw', required => 1, lazy => 1,
17 default => sub { [ 'dbi:SQLite:t/var/reaction_test_withdb.db' ] },
20 override 'new' => sub {
28 my $schema = $self->schema_class->connect(@{$self->connect_info});
29 $schema->deploy({ add_drop_table => 1 });
30 $schema->setup_test_data if $schema->can('setup_test_data');
31 $self->schema($schema);
38 Reaction::Test::WithDB
46 Deploys database schema, dropping tables if they already exist.
52 L<DBIx::Class::Schema>
58 Uses C<[ dbi:SQLite:t/var/reaction_test_withdb.db ]> by default.
66 See L<Reaction::Class> for authors.
70 See L<Reaction::Class> for the license.