Commit | Line | Data |
aba93491 |
1 | use strict; |
44c7ee79 |
2 | use warnings; |
aba93491 |
3 | |
4 | use Test::More; |
5 | use lib qw(t/lib); |
6 | use DBICTest; |
aba93491 |
7 | |
8 | BEGIN { |
f020d600 |
9 | eval "use DBD::SQLite; use SQL::Translator"; |
aba93491 |
10 | plan $@ |
f020d600 |
11 | ? ( skip_all => 'needs DBD::SQLite and SQL::Translator for testing' ) |
78006145 |
12 | : ( tests => 8 ); |
aba93491 |
13 | } |
14 | |
15 | my $schema = DBICTest->init_schema(no_populate => 1, no_deploy => 1); |
16 | |
17 | ok($schema, 'Created a Schema'); |
18 | isa_ok($schema->_journal_schema, 'DBIx::Class::Schema::Journal::DB', 'Actually have a schema object for the journaling'); |
19 | isa_ok($schema->_journal_schema->source('CDAuditHistory'), 'DBIx::Class::ResultSource', 'CDAuditHistory source exists'); |
20 | isa_ok($schema->_journal_schema->source('ArtistAuditLog'), 'DBIx::Class::ResultSource', 'ArtistAuditLog source exists'); |
21 | |
44c7ee79 |
22 | my $count = eval { |
43449fa6 |
23 | $schema->_journal_schema->resultset('ChangeLog')->count; |
aba93491 |
24 | }; |
25 | my $e = $@; |
26 | |
27 | is( $count, undef, "no count" ); |
43449fa6 |
28 | like( $e, qr/table.*changelog/, "missing table error" ); |
aba93491 |
29 | |
30 | $schema->journal_schema_deploy(); |
31 | |
43449fa6 |
32 | $count = eval { $schema->_journal_schema->resultset('ChangeLog')->count }; |
aba93491 |
33 | |
34 | is( $@, '', "no error" ); |
35 | is( $count, 0, "count is 0" ); |
36 | |