Permalink
Browse files

File::Spec for getting app.psgi in tests

File::Spec for getting app.psgi in tests
  • Loading branch information...
1 parent 5d3501f commit 718c8075f5a372c24711de97f6c2e905bb9af64e Zbigniew Lukasiak committed Feb 28, 2011
Showing with 10 additions and 3 deletions.
  1. +5 −1 Changes
  2. +1 −1 dist.ini
  3. +4 −1 t/main.t
View
@@ -6,5 +6,9 @@ Revision history for Plack::Middleware::Auth::Form.
0.002 2011-02-27
No "use feature ':5.10'".
-{{$NEXT}}
+0.004 2011-02-27
Minor doc fix.
+
+{{$NEXT}}
+ File::Spec to get the app.psgi file in tests.
+
View
@@ -3,7 +3,7 @@ author = Zbigniew Lukasiak <zby@cpan.org>
license = Artistic_2_0
copyright_holder = Zbigniew Lukasiak <zby@cpan.org>
copyright_year = 2011
-version = 0.004
+version = 0.005
[@Basic]
[AutoPrereqs]
View
@@ -3,7 +3,10 @@ use warnings;
use Test::More;
use Test::WWW::Mechanize::PSGI;
-my $app = do 't/app.psgi' || warn $! ? "Cannot find 't/app.psgi: $!" : "Cannot compile 't/app.psgi': $@";
+use File::Spec;
+
+my $psgi_file = File::Spec->catfile( 't', 'app.psgi' );
+my $app = do $psgi_file || die $! ? "Cannot find '$psgi_file': $!" : "Cannot compile '$psgi_file': $@";
my $mech = Test::WWW::Mechanize::PSGI->new( app => $app );
$mech->get( '/some_page' );

0 comments on commit 718c807

Please sign in to comment.