File-Next-OO
view release on metacpan or search on metacpan
#!perl
use strict;
use warnings;
use Test::More tests => 14;
BEGIN {
use_ok( 'File::Next::OO' );
}
# use Test::Differences;
# eq_or_diff \@got, [qw( a b c )], "testing arrays";
JUST_A_FILE: {
my $iter = File::Next::OO->new( 't/pod.t' );
isa_ok( $iter, 'CODE' );
my @actual = slurp( $iter );
my @expected = qw(
t/pod.t
);
_sets_match( \@expected, \@actual, 'JUST_A_FILE' );
}
NO_PARMS: {
my $iter = File::Next::OO->new( 't/swamp' );
isa_ok( $iter, 'CODE' );
my @actual = slurp( $iter );
my @expected = qw(
t/swamp/Makefile
t/swamp/Makefile.PL
t/swamp/c-header.h
t/swamp/c-source.c
t/swamp/javascript.js
t/swamp/parrot.pir
t/swamp/perl-test.t
t/swamp/perl-without-extension
t/swamp/perl.pl
t/swamp/perl.pm
t/swamp/perl.pod
t/swamp/a/a1
t/swamp/a/a2
t/swamp/b/b1
t/swamp/b/b2
t/swamp/c/c1
t/swamp/c/c2
);
@actual = grep { !/\.svn/ } @actual; # If I'm building this in my Subversion dir
_sets_match( \@expected, \@actual, 'NO_PARMS' );
# test slurp
@actual = File::Next::OO->new( 't/swamp' );
_sets_match( \@expected, \@actual, 'NO_PARMS_SLURP' );
}
MULTIPLE_STARTS: {
my $iter = File::Next::OO->new( 't/swamp/a', 't/swamp/b', 't/swamp/c' );
isa_ok( $iter, 'CODE' );
my @actual = slurp( $iter );
my @expected = qw(
t/swamp/a/a1
t/swamp/a/a2
t/swamp/b/b1
t/swamp/b/b2
t/swamp/c/c1
( run in 2.405 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )