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