[Bast-commits] r7488 - DBIx-Class/0.08/branches/pg_unqualified_schema/t

rbuels at dev.catalyst.perl.org rbuels at dev.catalyst.perl.org
Wed Sep 2 17:15:02 GMT 2009


Author: rbuels
Date: 2009-09-02 17:15:01 +0000 (Wed, 02 Sep 2009)
New Revision: 7488

Modified:
   DBIx-Class/0.08/branches/pg_unqualified_schema/t/72pg.t
Log:
some reorganization and cleanup of pg-specific tests

Modified: DBIx-Class/0.08/branches/pg_unqualified_schema/t/72pg.t
===================================================================
--- DBIx-Class/0.08/branches/pg_unqualified_schema/t/72pg.t	2009-09-02 12:16:01 UTC (rev 7487)
+++ DBIx-Class/0.08/branches/pg_unqualified_schema/t/72pg.t	2009-09-02 17:15:01 UTC (rev 7488)
@@ -6,27 +6,8 @@
 use lib qw(t/lib);
 use DBICTest;
 
-{
-  package DBICTest::Schema::Casecheck;
 
-  use strict;
-  use warnings;
-  use base 'DBIx::Class';
-
-  __PACKAGE__->load_components(qw/Core/);
-  __PACKAGE__->table('testschema.casecheck');
-  __PACKAGE__->add_columns(qw/id name NAME uc_name storecolumn/);
-  __PACKAGE__->column_info_from_storage(1);
-  __PACKAGE__->set_primary_key('id');
-
-  sub store_column {
-    my ($self, $name, $value) = @_;
-    $value = '#'.$value if($name eq "storecolumn");
-    $self->maybe::next::method($name, $value);
-  }
-}
-
-{
+BEGIN {
   package DBICTest::Schema::ArrayTest;
 
   use strict;
@@ -53,6 +34,29 @@
 )
 EOM
 
+
+########## Case check
+
+BEGIN {
+  package DBICTest::Schema::Casecheck;
+
+  use strict;
+  use warnings;
+  use base 'DBIx::Class';
+
+  __PACKAGE__->load_components(qw/Core/);
+  __PACKAGE__->table('testschema.casecheck');
+  __PACKAGE__->add_columns(qw/id name NAME uc_name storecolumn/);
+  __PACKAGE__->column_info_from_storage(1);
+  __PACKAGE__->set_primary_key('id');
+
+  sub store_column {
+    my ($self, $name, $value) = @_;
+    $value = '#'.$value if($name eq "storecolumn");
+    $self->maybe::next::method($name, $value);
+  }
+}
+
 DBICTest::Schema->load_classes( 'Casecheck', 'ArrayTest' );
 
 # make sure sqlt_type overrides work (::Storage::DBI::Pg does this)
@@ -133,18 +137,15 @@
 
 }
 
-# store_column is called once for create() for non sequence columns
 
-ok(my $storecolumn = $schema->resultset('Casecheck')->create({'storecolumn' => 'a'}));
 
-is($storecolumn->storecolumn, '#a'); # was '##a'
+{
 
-# This is in Core now, but it's here just to test that it doesn't break
-$schema->class('Artist')->load_components('PK::Auto');
+  # This is in Core now, but it's here just to test that it doesn't break
+  $schema->class('Artist')->load_components('PK::Auto');
+  cmp_ok( $schema->resultset('Artist')->count, '==', 0, 'this should start with an empty artist table');
 
-cmp_ok( $schema->resultset('Artist')->count, '==', 0, 'this should start with an empty artist table');
-
-{ # test that auto-pk also works with the defined search path by
+  # test that auto-pk also works with the defined search path by
   # un-schema-qualifying the table name
   my $artist_name_save = $schema->source("Artist")->name;
   $schema->source("Artist")->name("artist");
@@ -292,6 +293,10 @@
 }
 
 
+# store_column is called once for create() for non sequence columns
+ok(my $storecolumn = $schema->resultset('Casecheck')->create({'storecolumn' => 'a'}));
+is($storecolumn->storecolumn, '#a'); # was '##a'
+
 my $name_info = $schema->source('Casecheck')->column_info( 'name' );
 is( $name_info->{size}, 1, "Case sensitive matching info for 'name'" );
 




More information about the Bast-commits mailing list