OK, sequences finally working.
[dbsrgits/DBIx-Class-ResultSource-MultipleTableInheritance.git] / t / 04no_sequence_defined.t
index dedb510..4d84dc3 100644 (file)
@@ -4,9 +4,10 @@ use lib 't/lib';
 use Test::More qw(no_plan);
 use Test::Exception;
 use NoSequenceSalad;
+use Devel::Dwarn;
 
 BEGIN {
-  $ENV{DBIC_TRACE} = 0;
+    $ENV{DBIC_TRACE} = 0;
 }
 my ( $dsn, $user, $pass )
     = @ENV{ map {"DBICTEST_PG_${_}"} qw/DSN USER PASS/ };
@@ -18,11 +19,14 @@ EOM
 
 my $schema = NoSequenceSalad->connect( $dsn, $user, $pass );
 $schema->storage->ensure_connected;
+$schema->storage->dbh->{Warn} = 0;
 $schema->storage->_use_insert_returning(0);
 
 my $dir = "t/sql";    # tempdir(CLEANUP => 0);
 $schema->create_ddl_dir( ['PostgreSQL'], 0.1, $dir );
-$schema->deploy( { add_drop_table => 1, add_drop_view => 1 } );
+
+lives_ok { $schema->deploy( { add_drop_table => 1, add_drop_view => 1 } ) }
+"I can deploy the schema";
 
 isa_ok(
     $schema->source('Mesclun'),
@@ -34,7 +38,7 @@ my ( $bowl_of_salad, $bowl_of_salad1 );
 
 lives_ok {
     $bowl_of_salad = $schema->resultset('Mesclun')
-        ->create( { acidity => 4, spiciness => '10', fresh => 0 } );
+        ->create( { acidity => 4, spiciness => '10', fresh => 0, } );
 }
 "I can call a create on a view mesclun";
 
@@ -44,10 +48,12 @@ lives_ok {
 "I can do it for the other view, too";
 
 my $sqlt_object = $schema->{sqlt};
+
+#diag Dwarn $sqlt_object;
 is_deeply(
     [ map { $_->name } $sqlt_object->get_views ],
     [   qw/
-            salad 
+            salad
             mesclun
             /
     ],