fix loading connect_info from schema-defined connection (RT 48084)
[catagits/Catalyst-Model-DBIC-Schema.git] / t / 08helper.t
index 08951da..066a69d 100644 (file)
@@ -4,11 +4,13 @@ use warnings;
 use FindBin '$Bin';
 use lib "$Bin/lib";
 
-use Test::More tests => 40;
+use Test::More;
 use Test::Exception;
 use Catalyst::Helper::Model::DBIC::Schema;
-use Catalyst::Helper;
 use Storable 'dclone';
+eval "use Catalyst::Helper";
+plan skip_all => 'Catalyst::Helper required for tests' if $@;
+plan tests => 41;
 
 my $helper      = Catalyst::Helper->new;
 $helper->{base} = $Bin;
@@ -24,6 +26,9 @@ my $i;
 $i = instance(schema_class => 'ASchemaClass');
 is $i->old_schema, 1, '->load_classes detected correctly';
 
+throws_ok { $i = instance(args => [$static, 'DbI:SQLite:myapp.db']) }
+    qr/case matters/i, "wrong case for 'dbi:' DSN part";
+
 $i = instance(args => ['traits=Caching']);
 is_deeply $i->traits, ['Caching'], 'one trait';
 is $i->helper->{traits}, "['Caching']", 'one trait as string';