Amon2-Setup-Flavor-Teng

 view release on metacpan or  search on metacpan

t/Util.pm  view on Meta::CPAN

package t::Util;
use strict;
use warnings;
use base qw/Exporter/;
use File::Spec;
use FindBin;
use lib File::Spec->catfile($FindBin::Bin, '..', 'lib');
use Test::More;
use App::Prove;
use File::Basename;

our @EXPORT = qw/run_app_test slurp/;

sub run_app_test {
    my $name = shift;

    my $libpath = File::Spec->rel2abs(File::Spec->catfile(dirname(__FILE__), '..', 'lib'));

    chdir "t/apps/$name/" or die $!;

    my $app = App::Prove->new();
    $app->process_args('-Ilib', "-I$libpath", <t/*.t>);
    ok($app->run);
    done_testing;
}

sub slurp {
	my $fname = shift;
	open my $fh, '<', $fname or die "$fname: $!";
	do { local $/; <$fh> };
}

1;



( run in 0.592 second using v1.01-cache-2.11-cpan-97f6503c9c8 )