Test with BEFORE_APPLY; this is the ultimate usecase
Arthur Axel 'fREW' Schmidt [Sat, 17 Jul 2010 18:45:40 +0000 (13:45 -0500)]
t/lib/A/UselessRSLoader.pm [new file with mode: 0644]
t/lib/DBICTest/Schema/Employee.pm
t/resultset/components.t

diff --git a/t/lib/A/UselessRSLoader.pm b/t/lib/A/UselessRSLoader.pm
new file mode 100644 (file)
index 0000000..1ed4389
--- /dev/null
@@ -0,0 +1,7 @@
+package A::UselessRSLoader;
+
+use Class::C3::Componentised::LoadActions;
+
+AFTER_APPLY { $_[0]->result_source_instance->inject_resultset_components(['+A::Useless']) };
+
+1;
index 35f6075..b18ec11 100644 (file)
@@ -1,9 +1,9 @@
-package # hide from PAUSE 
+package # hide from PAUSE
     DBICTest::Schema::Employee;
 
 use base qw/DBICTest::BaseResult/;
 
-__PACKAGE__->load_components(qw( Ordered ));
+__PACKAGE__->load_components(qw( Ordered +A::UselessRSLoader));
 
 __PACKAGE__->table('employee');
 
index c4b54b6..cd637e9 100644 (file)
@@ -11,4 +11,6 @@ my $schema = DBICTest->init_schema;
 isa_ok $schema->resultset('Artist'), 'A::Useless', 'Artist RS';
 ok !$schema->resultset('CD')->isa('A::Useless'), 'CD RS is not A::Useless';
 
+isa_ok $schema->resultset('Employee'), 'A::Useless', 'Employee RS';
+
 done_testing;