added ensure_class_loaded method to Componentized, which should fix problems with...
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Plain.pm
CommitLineData
c6d74d3e 1package # hide from PAUSE
2 DBICTest::Plain;
50041f3c 3
4use strict;
5use warnings;
1752dc15 6use base qw/DBIx::Class::Schema/;
50041f3c 7use DBI;
8
9my $db_file = "t/var/Plain.db";
10
11unlink($db_file) if -e $db_file;
12unlink($db_file . "-journal") if -e $db_file . "-journal";
13mkdir("t/var") unless -d "t/var";
14
15my $dsn = "dbi:SQLite:${db_file}";
16
fc69fea6 17__PACKAGE__->load_classes("Test");
50041f3c 18my $schema = __PACKAGE__->compose_connection(__PACKAGE__, $dsn);
19
20my $dbh = DBI->connect($dsn);
21
22my $sql = <<EOSQL;
23CREATE TABLE test (
24 id INTEGER NOT NULL,
25 name VARCHAR(32) NOT NULL
26);
27
28INSERT INTO test (id, name) VALUES (1, 'DBIC::Plain is broken!');
29
30EOSQL
31
32$dbh->do($_) for split(/\n\n/, $sql);
33
341;