Ensure the component_class override require()s its value in a pipeline
[dbsrgits/DBIx-Class.git] / t / 05components.t
index 4b063bf..335fb06 100644 (file)
@@ -1,16 +1,21 @@
-#!/usr/bin/perl
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
 
 use strict;
 use warnings;
 use Test::More;
 
-use lib qw(t/lib);
-use DBICTest::ForeignComponent;
 
-plan tests => 2;
+use DBICTest;
+
+{
+  package DBICTest::SomeResult;
+  use base 'DBIx::Class::Core';
+  __PACKAGE__->table("boguz");
+}
 
 #   Tests if foreign component was loaded by calling foreign's method
-ok( DBICTest::ForeignComponent->foreign_test_method, 'foreign component' );
+ok( ! $INC{"DBICTest/ForeignComponent.pm"}, "DBICTest::ForeignComponent not yet loaded" );
+ok( DBICTest::SomeResult->result_class("DBICTest::ForeignComponent")->foreign_test_method, 'foreign component loaded correctly' );
 
 #   Test for inject_base to filter out duplicates
 {   package DBICTest::_InjectBaseTest;
@@ -34,3 +39,8 @@ is_deeply( \@DBICTest::_InjectBaseTest::ISA,
     /],
     'inject_base filters duplicates'
 );
+
+use_ok('DBIx::Class::AccessorGroup');
+use_ok('DBIx::Class::Componentised');
+
+done_testing;