fixes to dbicadmin -I test
Eden Cardim [Fri, 7 May 2010 22:02:25 +0000 (22:02 +0000)]
t/admin/04include.t
t/var/dbicadmincrap/lib/Foo.pm [new file with mode: 0644]

index 2874934..6213c5a 100644 (file)
@@ -12,11 +12,16 @@ BEGIN {
 
 if(use_ok 'DBIx::Class::Admin') {
   my $admin = DBIx::Class::Admin->new(
-      include_dirs => 't/var/dbicadmincrap/lib',
-      schema_class => 'Foo'
+      include_dirs => ['t/var/dbicadmincrap/lib'],
+      schema_class => 'Foo',
+      config => { Foo => {} },
+      config_stanza => 'Foo'
   );
   lives_ok { $admin->_build_schema } 'should survive attempt to load module located in include_dirs';
-  ok($Foo::loaded);
+  {
+    no warnings 'once';
+    ok($Foo::loaded);
+  }
 }
 
 done_testing;
diff --git a/t/var/dbicadmincrap/lib/Foo.pm b/t/var/dbicadmincrap/lib/Foo.pm
new file mode 100644 (file)
index 0000000..2801e9e
--- /dev/null
@@ -0,0 +1,7 @@
+package Foo;
+
+our $loaded = 1;
+
+sub connect {}
+
+1;