allow for multipk
[dbsrgits/DBIx-Class-Journal.git] / t / 02noautodeploy.t
CommitLineData
aba93491 1use strict;
44c7ee79 2use warnings;
aba93491 3
4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
aba93491 7
8BEGIN {
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
15my $schema = DBICTest->init_schema(no_populate => 1, no_deploy => 1);
16
17ok($schema, 'Created a Schema');
bf4f93f7 18isa_ok(
19 $schema->_journal_schema,
20 'DBIx::Class::Schema::Journal::DB',
21 'Actually have a schema object for the journaling'
22);
23isa_ok(
24 $schema->_journal_schema->source('CDAuditHistory'),
25 'DBIx::Class::ResultSource',
26 'CDAuditHistory source exists'
27);
28isa_ok(
29 $schema->_journal_schema->source('ArtistAuditLog'),
30 'DBIx::Class::ResultSource',
31 'ArtistAuditLog source exists'
32);
aba93491 33
44c7ee79 34my $count = eval {
43449fa6 35 $schema->_journal_schema->resultset('ChangeLog')->count;
aba93491 36};
37my $e = $@;
38
bf4f93f7 39is( $count, undef, 'no count' );
40like( $e, qr/table.*changelog/, 'missing table error' );
aba93491 41
42$schema->journal_schema_deploy();
43
43449fa6 44$count = eval { $schema->_journal_schema->resultset('ChangeLog')->count };
aba93491 45
46is( $@, '', "no error" );
47is( $count, 0, "count is 0" );
48