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