Adjust view-dependency tests to work on newer libsqlite
[dbsrgits/DBIx-Class.git] / t / cdbi / 09-has_many.t
index 96b50c0..a19500a 100644 (file)
@@ -1,14 +1,9 @@
-use strict;
-use Test::More;
+use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat';
 
+use strict;
+use warnings;
 
-BEGIN {
-  eval "use DBIx::Class::CDBICompat;";
-  plan skip_all => 'Class::Trigger and DBIx::ContextualFetch required' if $@;
-  eval "use DBD::SQLite";
-  plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 31);
-}
-
+use Test::More;
 
 use lib 't/cdbi/testlib';
 use Film;
@@ -54,7 +49,7 @@ eval { my $pj = Film->add_to_actors(\%pj_data) };
 like $@, qr/class/, "add_to_actors must be object method";
 
 eval { my $pj = $btaste->add_to_actors(%pj_data) };
-like $@, qr/needs/, "add_to_actors takes hash";
+like $@, qr/Result object instantiation requires a hashref as argument/, "add_to_actors takes hash";
 
 ok(
   my $pj = $btaste->add_to_actors(
@@ -125,3 +120,5 @@ is($as->Name, 'Arnold Schwarzenegger', "Arnie's still Arnie");
 
     is_deeply [sort map { $_->id } $other_thing->things], [1,2];
 }
+
+done_testing;