test for the dbicadmin -I option
Eden Cardim [Fri, 7 May 2010 22:02:00 +0000 (22:02 +0000)]
t/admin/04include.t [new file with mode: 0644]

diff --git a/t/admin/04include.t b/t/admin/04include.t
new file mode 100644 (file)
index 0000000..2874934
--- /dev/null
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Exception;
+
+BEGIN {
+    require DBIx::Class;
+    plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('admin')
+      unless DBIx::Class::Optional::Dependencies->req_ok_for('admin');
+}
+
+if(use_ok 'DBIx::Class::Admin') {
+  my $admin = DBIx::Class::Admin->new(
+      include_dirs => 't/var/dbicadmincrap/lib',
+      schema_class => 'Foo'
+  );
+  lives_ok { $admin->_build_schema } 'should survive attempt to load module located in include_dirs';
+  ok($Foo::loaded);
+}
+
+done_testing;