Warn-free test suite with later DBIC
[dbsrgits/DBIx-Class-DeploymentHandler.git] / t / bugs / 01-emailed-bug-01.t
CommitLineData
ba99ba44 1#!perl
2
3use strict;
4use warnings;
5
6use lib 't/lib';
7use DBICDHTest;
8use DBIx::Class::DeploymentHandler;
9use aliased 'DBIx::Class::DeploymentHandler', 'DH';
10
11use File::Path 'remove_tree';
12use Test::More;
13use Test::Exception;
14
15DBICDHTest::ready;
16
f3b5161e 17my $dbh = DBICDHTest::dbh();
ba99ba44 18my @connection = (sub { $dbh }, { ignore_version => 1 });
19my $sql_dir = 't/sql';
20
21use_ok 'DBICVersion_v1';
22my $s = DBICVersion::Schema->connect(@connection);
23$DBICVersion::Schema::VERSION = 1;
24ok($s, 'DBICVersion::Schema 1 instantiates correctly');
25
26my $dh = DH->new({
27 script_directory => $sql_dir,
28 schema => $s,
29 databases => 'SQLite',
30 sql_translator_args => { add_drop_table => 0 },
31});
32
33ok($dh, 'DBIx::Class::DeploymentHandler w/1 instantiates correctly');
34$dh->prepare_version_storage_install;
35
36
37dies_ok { $s->resultset('__VERSION')->first->version } 'version_storage not installed';
38$dh->install_version_storage;
39
40$dh->add_database_version( { version => $s->schema_version } );
41
42lives_ok { $s->resultset('__VERSION')->first->version } 'version_storage installed';
43
44done_testing;