Created
August 8, 2012 02:48
-
-
Save mash/3291615 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Test::Archive; | |
use strict; | |
use warnings; | |
use parent 'Test::Builder::Module'; | |
use Test::More; | |
use Archive::Zip; | |
our @ISA = qw/Exporter/; | |
our @EXPORT = qw/is_archive_deeply/; | |
our $ignore_regexp = qr!(?:/$|__MACOSX/|\.DS_Store)!; | |
sub is_archive_deeply { | |
my ($zipfile, $expected, $name) = @_; | |
my $zip = Archive::Zip->new( $zipfile ); | |
my $memberNames = [ sort grep { | |
$_ !~ $ignore_regexp; | |
} $zip->memberNames() ]; | |
my $builder = Test::Builder->new; | |
$builder->level( 2 ); | |
Test::More::is_deeply( $memberNames, [ sort @{ $expected } ], $name ); | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment