[Bast-commits] r3352 - in branches/DBIx-Class-current: . t
groditi at dev.catalyst.perl.org
groditi at dev.catalyst.perl.org
Mon May 21 23:29:12 GMT 2007
Author: groditi
Date: 2007-05-21 23:29:11 +0100 (Mon, 21 May 2007)
New Revision: 3352
Added:
branches/DBIx-Class-current/t/97result_class.t
Modified:
branches/DBIx-Class-current/Changes
Log:
result_class is getting leaked somewhere in related_resultset, failing test included
Modified: branches/DBIx-Class-current/Changes
===================================================================
--- branches/DBIx-Class-current/Changes 2007-05-21 21:06:23 UTC (rev 3351)
+++ branches/DBIx-Class-current/Changes 2007-05-21 22:29:11 UTC (rev 3352)
@@ -10,6 +10,7 @@
not a foreign constraint is needed
- resultset_class/result_class now (again) auto loads the specified
class; requires Class::Accessor::Grouped 0.05002+
+ - added 97result_class.t test, failing ATM
0.07006 2007-04-17 23:18:00
- Lots of documentation updates
Added: branches/DBIx-Class-current/t/97result_class.t
===================================================================
--- branches/DBIx-Class-current/t/97result_class.t (rev 0)
+++ branches/DBIx-Class-current/t/97result_class.t 2007-05-21 22:29:11 UTC (rev 3352)
@@ -0,0 +1,38 @@
+use strict;
+use warnings;
+
+use Test::More;
+use lib qw(t/lib);
+use DBICTest;
+
+my $schema = DBICTest->init_schema();
+
+plan tests => 7;
+
+{
+ my $cd_rc = $schema->resultset("CD")->result_class;
+
+ my $artist_rs = $schema->resultset("Artist")
+ ->search_rs({}, {result_class => "IWillExplode"});
+ is($artist_rs->result_class, 'IWillExplode', 'Correct artist result_class');
+
+ my $cd_rs = $artist_rs->related_resultset('cds');
+ is($cd_rs->result_class, $cd_rc, 'Correct cd result_class');
+
+ isa_ok(eval {$cd_rs->find(1) }, $cd_rc, 'Inflated into correct cd result_class');
+}
+
+
+{
+ my $cd_rc = $schema->resultset("CD")->result_class;
+
+ my $artist_rs = $schema->resultset("Artist")
+ ->search_rs({}, {result_class => "IWillExplode"})->search({artistis => 1});
+ is($artist_rs->result_class, 'IWillExplode', 'Correct artist result_class');
+
+ my $cd_rs = $artist_rs->related_resultset('cds');
+ is($cd_rs->result_class, $cd_rc, 'Correct cd result_class');
+
+ isa_ok(eval{ $cd_rs->find(1) }, $cd_rc, 'Inflated into correct cd result_class');
+ isa_ok(eval { $cd_rs->search({ cdid => 1 })->first}, $cd_rc, 'Inflated into correct cd result_class');
+}
More information about the Bast-commits
mailing list