add proper test for column names with punctuation, bump CAG dep for fix
Rafael Kitover [Sat, 12 Jun 2010 08:47:28 +0000 (04:47 -0400)]
Changes
Makefile.PL
t/63register_column.t [new file with mode: 0644]
t/lib/DBICTest/Schema/PunctuatedColumnName.pm [new file with mode: 0644]

diff --git a/Changes b/Changes
index e5d5b23..d33253b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -16,6 +16,8 @@ Revision history for DBIx::Class
           failures
         - Fixed distinct with order_by to not double-specify the same
           column in the GROUP BY clause
+        - Properly support column names with symbols (e.g. single quote)
+          via custom accessors
 
     * Misc
         - Refactored capability handling in Storage::DBI, allows for
index c63a12a..8443be8 100644 (file)
@@ -48,7 +48,7 @@ my $test_requires = {
 
 my $runtime_requires = {
   'Carp::Clan'               => '6.0',
-  'Class::Accessor::Grouped' => '0.09003',
+  'Class::Accessor::Grouped' => '0.09004',
   'Class::C3::Componentised' => '1.0005',
   'Class::Inspector'         => '1.24',
   'Data::Page'               => '2.00',
diff --git a/t/63register_column.t b/t/63register_column.t
new file mode 100644 (file)
index 0000000..49d37bb
--- /dev/null
@@ -0,0 +1,13 @@
+use strict;
+use warnings;  
+
+use Test::More;
+use Test::Exception;
+use lib qw(t/lib);
+use DBICTest;
+
+lives_ok {
+  DBICTest::Schema->load_classes('PunctuatedColumnName')
+} 'registered columns with weird names';
+
+done_testing;
diff --git a/t/lib/DBICTest/Schema/PunctuatedColumnName.pm b/t/lib/DBICTest/Schema/PunctuatedColumnName.pm
new file mode 100644 (file)
index 0000000..7d48f87
--- /dev/null
@@ -0,0 +1,31 @@
+package # hide from PAUSE 
+    DBICTest::Schema::PunctuatedColumnName;
+
+use base qw/DBICTest::BaseResult/;
+
+__PACKAGE__->table('punctuated_column_name');
+__PACKAGE__->add_columns(
+  'id' => {
+    data_type => 'integer',
+    is_auto_increment => 1,
+  },
+  q{foo ' bar} => {
+    data_type => 'integer',
+    is_nullable => 1,
+    accessor => 'foo_bar',
+  },
+  q{bar/baz} => {
+    data_type => 'integer',
+    is_nullable => 1,
+    accessor => 'bar_baz',
+  },
+  q{baz;quux} => {
+    data_type => 'integer',
+    is_nullable => 1,
+    accessor => 'bar_quux',
+  },
+);
+
+__PACKAGE__->set_primary_key('id');
+
+1;