From: Arthur Axel 'fREW' Schmidt Date: Sat, 17 Jul 2010 18:45:40 +0000 (-0500) Subject: Test with BEFORE_APPLY; this is the ultimate usecase X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a17a822d3297538490e64f40b126608cfd5c0b1f;p=dbsrgits%2FDBIx-Class.git Test with BEFORE_APPLY; this is the ultimate usecase --- diff --git a/t/lib/A/UselessRSLoader.pm b/t/lib/A/UselessRSLoader.pm new file mode 100644 index 0000000..1ed4389 --- /dev/null +++ b/t/lib/A/UselessRSLoader.pm @@ -0,0 +1,7 @@ +package A::UselessRSLoader; + +use Class::C3::Componentised::LoadActions; + +AFTER_APPLY { $_[0]->result_source_instance->inject_resultset_components(['+A::Useless']) }; + +1; diff --git a/t/lib/DBICTest/Schema/Employee.pm b/t/lib/DBICTest/Schema/Employee.pm index 35f6075..b18ec11 100644 --- a/t/lib/DBICTest/Schema/Employee.pm +++ b/t/lib/DBICTest/Schema/Employee.pm @@ -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'); diff --git a/t/resultset/components.t b/t/resultset/components.t index c4b54b6..cd637e9 100644 --- a/t/resultset/components.t +++ b/t/resultset/components.t @@ -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;