EPublisher

 view release on metacpan or  search on metacpan

t/source_dir.t  view on Meta::CPAN

    );

    my @pods = $source->load_source;
    is_deeply \@pods, [];
    is $debug, '';
}

{
    $debug = '';
    my $source = EPublisher::Source::Plugin::Dir->new({
        path => $dir,
        exclude => ['t/pods/Test.pod'],
    },
        publisher => Mock::Publisher->new,
    );

    my @pods = $source->load_source;
    is_deeply \@pods, [];
    is $debug, '';
}

{
    $debug = '';
    my $source = EPublisher::Source::Plugin::Dir->new(
        {},
        publisher => Mock::Publisher->new,
    );

    my @pods = $source->load_source( $dir );
    is_deeply \@pods, [ { pod => $test_pod, title => 'Test.pod', filename => 'Test.pod' } ];
    is $debug, '';
}

{
    $debug = '';
    my $source = EPublisher::Source::Plugin::Dir->new(
        { title => 'test' },
        publisher => Mock::Publisher->new,
    );

    my @pods = $source->load_source( $dir );
    is_deeply \@pods, [ { pod => $test_pod, title => 'test', filename => 'Test.pod' } ];
    is $debug, '';
}

{
    $debug = '';
    my $source = EPublisher::Source::Plugin::Dir->new(
        { title => 'pod' },
        publisher => Mock::Publisher->new,
    );

    my @pods = $source->load_source( $dir );
    is_deeply \@pods, [ { pod => $test_pod, title => 'TEST', filename => 'Test.pod' } ];
    is $debug, '';
}

done_testing();

sub slurp {
    local (@ARGV, $/) = shift;
    <>;
}

{
    package
        Mock::Publisher;

    sub new { bless {}, shift }
    sub debug { $debug = $_[1] };
}



( run in 2.769 seconds using v1.01-cache-2.11-cpan-364913b4093 )