remove useless shebangs in tests
[gitmo/MooseX-Storage.git] / t / 030_with_checksum.t
index a87a163..18934f8 100644 (file)
@@ -1,21 +1,22 @@
-#!/usr/bin/perl
-
 use strict;
 use warnings;
 
 use Test::More;
-use Test::Exception;
+use Test::Fatal;
 use Test::Deep;
 
+use Test::Requires {
+    'Digest' => 0.01, # skip all if not installed
+    'Digest::SHA' => 0.00,
+    'JSON::Any' => 0.01,
+};
+
 BEGIN {
-    eval "use Digest; use Digest::SHA1";
-    plan skip_all => "Digest and Digest::SHA1 is required for this test" if $@;           
-    plan tests => 25;
+    plan tests => 26;
     use_ok('MooseX::Storage');
 }
 
 {
-
     package Foo;
     use Moose;
     use MooseX::Storage;
@@ -63,9 +64,9 @@ BEGIN {
     );
 
     my $foo2;
-    lives_ok {
+    is( exception {
         $foo2 = Foo->unpack($packed);
-    } '... unpacked okay';
+    }, undef, '... unpacked okay');
     isa_ok($foo2, 'Foo');
     
     cmp_deeply(
@@ -115,7 +116,7 @@ BEGIN {
 
 SKIP: {
     eval { require Digest::HMAC_SHA1 };
-    skip join( " ", "no Digest::HMAC", ( $@ =~ /\@INC/ ? () : do { chomp(my $e = $@); "($e)" } ) ), 14 if $@;
+    skip join( " ", "no Digest::HMAC", ( $@ =~ /\@INC/ ? () : do { chomp(my $e = $@); "($e)" } ) ), 15 if $@;
 
     local $::DEBUG = 1;