Skip to content

Instantly share code, notes, and snippets.

@wolverian
Created December 9, 2010 16:39
Show Gist options
  • Save wolverian/734940 to your computer and use it in GitHub Desktop.
Save wolverian/734940 to your computer and use it in GitHub Desktop.
Plack::Test, dzil and paths
use strict;
use warnings;
use Test::Most;
use Plack::Test;
use HTTP::Request::Common;
use Cwd;
my $app_path = cwd() . '/bin/dicole-eventserver.psgi';
my $app = do($app_path) or die "$!: $app_path\n";
subtest todo => sub {
test_psgi
app => $app,
client => sub {
my $app = shift;
my $res = $app->(GET "/extend");
ok $res->is_error;
};
};
done_testing;
# Result:
# loki:Dicole-EventServer wolverian$ dzil test
# [DZ] building test distribution under .build/AVMVMUFNhH
# [DZ] beginning to build Dicole-EventServer
# [DZ] guessing dist's main_module is lib/Dicole/EventBroker.pm
# [DZ] extracting distribution abstract from lib/Dicole/EventBroker.pm
# [DZ] writing Dicole-EventServer in .build/AVMVMUFNhH
# Checking if your kit is complete...
# Looks good
# Warning: prerequisite AnyEvent::HTTP 0 not found.
# Writing Makefile for Dicole::EventServer
# cp lib/Dicole/EventFetcher.pm blib/lib/Dicole/EventFetcher.pm
# cp lib/Dicole/EventBroker.pm blib/lib/Dicole/EventBroker.pm
# cp bin/dicole-eventserver.psgi~ blib/script/dicole-eventserver.psgi~
# /Users/wolverian/perl5/perlbrew/perls/perl-5.12.1/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/dicole-eventserver.psgi~
# cp bin/dicole-eventserver.psgi blib/script/dicole-eventserver.psgi
# /Users/wolverian/perl5/perlbrew/perls/perl-5.12.1/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/dicole-eventserver.psgi
# PERL_DL_NONLAZY=1 /Users/wolverian/perl5/perlbrew/perls/perl-5.12.1/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
# t/dicole-eventserver.t .. No such file or directory: /Users/wolverian/code/Dicole-EventServer/.build/AVMVMUFNhH/bin/dicole-eventserver.psgi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment