[libdancer-plugin-dbic-perl] 02/04: get rid of eval {} and make use of Test::Requires instead

Jonas Smedegaard dr at jones.dk
Fri Aug 7 12:23:20 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag v0.2101
in repository libdancer-plugin-dbic-perl.

commit c2b09c695a711a336e753771926c01d4a53a4c31
Author: Patrice Clement <monsieurp at gentoo.org>
Date:   Sun Jan 11 19:48:35 2015 +0100

    get rid of eval {} and make use of Test::Requires instead
---
 t/03-dynamic-schemas.t | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/t/03-dynamic-schemas.t b/t/03-dynamic-schemas.t
index 003f1f3..fdc1a98 100644
--- a/t/03-dynamic-schemas.t
+++ b/t/03-dynamic-schemas.t
@@ -3,20 +3,15 @@
 
 use strict;
 use warnings;
-use Test::More;
+use Test::More tests => 3;
 
 use Dancer qw(:syntax !pass);
 use Dancer::Plugin::DBIC;
 use DBI;
 use File::Temp qw(tempfile);
-
-eval { require DBD::SQLite; require DBIx::Class::Schema::Loader };
-if ($@) {
-    plan skip_all =>
-        'DBD::SQLite and DBIx::Class::Schema::Loader required for these tests';
-} else {
-    plan tests => 3;
-}
+use Test::Requires qw(
+    DBD::SQLite DBIx::Class::Schema::Loader
+);
 
 my (undef, $dbfile) = tempfile SUFFIX => '.db';
 
@@ -37,6 +32,7 @@ my @users = ( ['bob', 40] );
 for my $user (@users) { $dbh->do('insert into user values(?,?)', {}, @$user) }
 
 my $user = schema('foo')->resultset('User')->find('bob');
+
 ok $user, 'Found bob.';
 is $user->age => '40', 'bob is even older';
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdancer-plugin-dbic-perl.git



More information about the Pkg-perl-cvs-commits mailing list