5 use Test::More qw(no_plan);
14 my ( $dsn, $user, $pass )
15 = @ENV{ map {"DBICTEST_PG_${_}"} qw/DSN USER PASS/ };
17 plan skip_all => <<'EOM' unless $dsn && $user;
18 Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test
19 ( NOTE: This test drops and creates some tables.')
22 dies_ok { LoadTest->source('Foo')->view_definition }
23 "Can't generate view def without connected schema";
25 my $schema = LoadTest->connect( $dsn, $user, $pass );
27 my $dir = "t/sql"; # tempdir(CLEANUP => 0);
29 lives_ok { $schema->create_ddl_dir( ['PostgreSQL'], 0.1, $dir ) }
30 "It's OK to create_ddl_dir";
32 $schema->deploy( { add_drop_table => 1, add_drop_view => 1, } );
34 "It's also OK to deploy the schema";
36 my $sqlt_object = $schema->{sqlt};
39 [ map { $_->name } $sqlt_object->get_views ],
45 "SQLT view order triumphantly matches our order."