[Bast-commits] r9409 - DBIx-Class/0.08/trunk/t/inflate
matthewt at dev.catalyst.perl.org
matthewt at dev.catalyst.perl.org
Thu May 20 17:49:32 GMT 2010
Author: matthewt
Date: 2010-05-20 18:49:32 +0100 (Thu, 20 May 2010)
New Revision: 9409
Modified:
DBIx-Class/0.08/trunk/t/inflate/hri.t
Log:
forgot to commit fixes
Modified: DBIx-Class/0.08/trunk/t/inflate/hri.t
===================================================================
--- DBIx-Class/0.08/trunk/t/inflate/hri.t 2010-05-20 17:36:01 UTC (rev 9408)
+++ DBIx-Class/0.08/trunk/t/inflate/hri.t 2010-05-20 17:49:32 UTC (rev 9409)
@@ -9,14 +9,15 @@
# Under some versions of SQLite if the $rs is left hanging around it will lock
# So we create a scope here cos I'm lazy
{
- my $rs = $schema->resultset('CD')->search ({}, { order_by => 'cdid' });
+ my $rs = $schema->resultset('CD')->search ({}, {
+ order_by => 'cdid',
+ # use the hashref inflator class as result class
+ result_class => 'DBIx::Class::ResultClass::HashRefInflator',
+ });
# get the defined columns
my @dbic_cols = sort $rs->result_source->columns;
- # use the hashref inflator class as result class
- $rs->result_class('DBIx::Class::ResultClass::HashRefInflator');
-
# fetch first record
my $datahashref1 = $rs->first;
@@ -29,6 +30,16 @@
my $cd2 = $rs->search({ cdid => 1 })->single;
is_deeply ( $cd2, $datahashref1, 'first/search+single return the same thing');
+
+ $rs->result_class('DBIx::Class::Row');
+
+ is( $rs->result_class, 'DBIx::Class::Row', 'result_class set' );
+
+ is(
+ $rs->search->result_class, 'DBIx::Class::ResultClass::HashRefInflator',
+ 'result_class set using accessor does not propagate over search'
+ );
+
}
sub check_cols_of {
More information about the Bast-commits
mailing list