From: Yuval Kogman Date: Tue, 29 Jul 2008 17:54:05 +0000 (+0000) Subject: journal_no_auto_deploy X-Git-Tag: v0.900201~94 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=faa4607e595a9f90783dd13fdb45ac1569898da2;p=dbsrgits%2FDBIx-Class-Journal.git journal_no_auto_deploy --- diff --git a/t/01test.t b/t/01test.t index 7b5b4f1..9f419af 100644 --- a/t/01test.t +++ b/t/01test.t @@ -10,7 +10,7 @@ BEGIN { eval "use DBD::SQLite"; plan $@ ? ( skip_all => 'needs DBD::SQLite for testing' ) - : ( tests => 12 ); + : ( tests => 14 ); } my $schema = DBICTest->init_schema(no_populate => 1); @@ -20,6 +20,18 @@ isa_ok($schema->_journal_schema, 'DBIx::Class::Schema::Journal::DB', 'Actually h isa_ok($schema->_journal_schema->source('CDAuditHistory'), 'DBIx::Class::ResultSource', 'CDAuditHistory source exists'); isa_ok($schema->_journal_schema->source('ArtistAuditLog'), 'DBIx::Class::ResultSource', 'ArtistAuditLog source exists'); +{ + my $count = eval { + warn $schema->_journal_schema->resultset('ArtistAuditLog')->count; + }; + my $e = $@; + + is( $count, undef, "no count" ); + like( $e, qr/table.*artist_audit_log/i, "missing table error" ); +} + +$schema->journal_schema_deploy(); + my $artist; my $new_cd = $schema->txn_do( sub { $artist = $schema->resultset('Artist')->create({ diff --git a/t/lib/DBICTest/Schema.pm b/t/lib/DBICTest/Schema.pm index 2650f3e..ffe1777 100644 --- a/t/lib/DBICTest/Schema.pm +++ b/t/lib/DBICTest/Schema.pm @@ -5,8 +5,9 @@ use base qw/DBIx::Class::Schema/; __PACKAGE__->load_components(qw/+DBIx::Class::Schema::Journal/); +__PACKAGE__->journal_no_automatic_deploy(1); + __PACKAGE__->journal_connection(['dbi:SQLite:t/var/Audit.db']); -__PACKAGE__->journal_user(['DBICTest::Schema::Artist', {'foreign.artistid' => 'self.user_id'}]); no warnings qw/qw/; DBICTest::Schema->load_classes(