Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Upped Plack dependency to support localizing $0. Fixes gh-19

  • Loading branch information...
commit 45e0b6f48f833a1d07eda3983ec5e70fa261cf6f 1 parent 16fbfe4
@miyagawa miyagawa authored
Showing with 28 additions and 1 deletion.
  1. +2 −1  Makefile.PL
  2. +6 −0 t/findbin.psgi
  3. +20 −0 t/findbin.t
View
3  Makefile.PL
@@ -8,13 +8,14 @@ name 'Starman';
all_from 'lib/Starman.pm';
readme_from 'lib/Starman.pm';
build_requires 'Test::More';
-requires 'Plack', 0.9931;
+requires 'Plack', 0.9971;
requires 'Net::Server', 0.91;
requires 'Data::Dump';
requires 'HTTP::Parser::XS';
requires 'HTTP::Status';
requires 'HTTP::Date';
requires 'parent';
+requires 'Test::TCP', 1.11;
install_script 'bin/starman';
recommends 'Server::Starter';
recommends 'Net::Server::SS::PreFork';
View
6 t/findbin.psgi
@@ -0,0 +1,6 @@
+use strict;
+use FindBin;
+sub {
+ my $env = shift;
+ return [ 200, [ "Content-Type", "text/plain" ], [ $FindBin::Bin ] ];
+};
View
20 t/findbin.t
@@ -0,0 +1,20 @@
+use Test::TCP;
+use LWP::UserAgent;
+use FindBin;
+use Test::More;
+
+my $s = Test::TCP->new(
+ code => sub {
+ my $port = shift;
+ exec "$^X bin/starman --port $port --max-requests=1 --workers=1 $FindBin::Bin/findbin.psgi";
+ },
+);
+
+my $ua = LWP::UserAgent->new;
+
+for (1..2) {
+ my $res = $ua->get("http://localhost:" . $s->port);
+ is $res->content, $FindBin::Bin;
+}
+
+done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.