Actually updated the changes file! lookitme, andyg!
[dbsrgits/DBIx-Class.git] / t / 12pg.t
1 use lib qw(lib t/lib);
2 use DBICTest::Schema;
3
4 use Test::More;
5
6 my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
7
8 #warn "$dsn $user $pass";
9
10 plan skip_all, 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
11   unless ($dsn && $user);
12
13 plan tests => 1;
14
15 DBICTest::Schema->compose_connection('PgTest' => $dsn, $user, $pass);
16
17 my $dbh = PgTest::Artist->storage->dbh;
18
19 eval {
20   $dbh->do("DROP TABLE artist;");
21 };
22
23 $dbh->do("CREATE TABLE artist (artistid serial PRIMARY KEY, name VARCHAR(255));");
24
25 PgTest::Artist->load_components('PK::Auto::Pg');
26
27 my $new = PgTest::Artist->create({ name => 'foo' });
28
29 ok($new->artistid, "Auto-PK worked");
30
31 1;