Hello community, here is the log from the commit of package perl-Plack for openSUSE:Factory checked in at 2013-10-21 15:14:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Plack (Old) and /work/SRC/openSUSE:Factory/.perl-Plack.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Plack" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Plack/perl-Plack.changes 2013-07-09 20:57:41.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Plack.new/perl-Plack.changes 2013-10-21 15:14:30.000000000 +0200 @@ -1,0 +2,16 @@ +Fri Oct 4 09:12:16 UTC 2013 - [email protected] + +- updated to 1.0029 + [NEW FEATURES] + - Plack::Test now has a simpler object-oriented interface that doesn't + take multiple callbacks. #420 + + [IMPROVEMENTS] + - bump dependencies for Test::TCP and HTTP::Tiny + - Set no_proxy for HTTP::Tiny in tests (kazeburo) + + [INCOMPATIBLE CHANGES] + - Split HTTP::Server::Simple handler from Plack distribution and merge to + HTTP-Server-Simple-PSGI distribution + +------------------------------------------------------------------- Old: ---- Plack-1.0028.tar.gz New: ---- Plack-1.0029.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Plack.spec ++++++ --- /var/tmp/diff_new_pack.ZJJnTT/_old 2013-10-21 15:14:33.000000000 +0200 +++ /var/tmp/diff_new_pack.ZJJnTT/_new 2013-10-21 15:14:33.000000000 +0200 @@ -17,14 +17,14 @@ Name: perl-Plack -Version: 1.0028 +Version: 1.0029 Release: 0 %define cpan_name Plack Summary: Perl Superglue for Web frameworks and Web Servers (PSGI toolkit) License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Plack/ -Source: http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/%{cpan_name}-%{version}.tar.gz +Source: http://www.cpan.org/authors/id/M/MI/MIYAGAWA/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl @@ -37,13 +37,13 @@ BuildRequires: perl(Filesys::Notify::Simple) BuildRequires: perl(HTTP::Body) >= 1.06 BuildRequires: perl(HTTP::Message) >= 5.814 -BuildRequires: perl(HTTP::Tiny) >= 0.024 +BuildRequires: perl(HTTP::Tiny) >= 0.034 BuildRequires: perl(Hash::MultiValue) >= 0.05 BuildRequires: perl(Pod::Usage) >= 1.36 BuildRequires: perl(Stream::Buffered) >= 0.02 BuildRequires: perl(Test::More) >= 0.88 BuildRequires: perl(Test::Requires) -BuildRequires: perl(Test::TCP) >= 1.02 +BuildRequires: perl(Test::TCP) >= 2.00 BuildRequires: perl(Try::Tiny) BuildRequires: perl(URI) >= 1.59 BuildRequires: perl(parent) @@ -54,11 +54,11 @@ Requires: perl(Filesys::Notify::Simple) Requires: perl(HTTP::Body) >= 1.06 Requires: perl(HTTP::Message) >= 5.814 -Requires: perl(HTTP::Tiny) >= 0.024 +Requires: perl(HTTP::Tiny) >= 0.034 Requires: perl(Hash::MultiValue) >= 0.05 Requires: perl(Pod::Usage) >= 1.36 Requires: perl(Stream::Buffered) >= 0.02 -Requires: perl(Test::TCP) >= 1.02 +Requires: perl(Test::TCP) >= 2.00 Requires: perl(Try::Tiny) Requires: perl(URI) >= 1.59 Requires: perl(parent) ++++++ Plack-1.0028.tar.gz -> Plack-1.0029.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/Changes new/Plack-1.0029/Changes --- old/Plack-1.0028/Changes 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/Changes 2013-08-22 23:05:49.000000000 +0200 @@ -1,5 +1,18 @@ Go to http://github.com/plack/Plack/issues for the roadmap and known issues. +1.0029 2013-08-22 14:05:44 PDT + [NEW FEATURES] + - Plack::Test now has a simpler object-oriented interface that doesn't + take multiple callbacks. #420 + + [IMPROVEMENTS] + - bump dependencies for Test::TCP and HTTP::Tiny + - Set no_proxy for HTTP::Tiny in tests (kazeburo) + + [INCOMPATIBLE CHANGES] + - Split HTTP::Server::Simple handler from Plack distribution and merge to + HTTP-Server-Simple-PSGI distribution + 1.0028 2013-06-15 01:42:52 PDT [IMPROVEMENTS] - Skip cgi related tests for Win32 (chorny) #413 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/MANIFEST new/Plack-1.0029/MANIFEST --- old/Plack-1.0028/MANIFEST 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/MANIFEST 2013-08-22 23:05:49.000000000 +0200 @@ -48,7 +48,6 @@ lib/Plack/Handler/CGI.pm lib/Plack/Handler/FCGI.pm lib/Plack/Handler/HTTP/Server/PSGI.pm -lib/Plack/Handler/HTTP/Server/Simple.pm lib/Plack/Handler/Standalone.pm lib/Plack/LWPish.pm lib/Plack/Loader.pm @@ -119,7 +118,6 @@ t/Plack-Handler/apache2.t t/Plack-Handler/cgi.t t/Plack-Handler/fcgi.t -t/Plack-Handler/http_server_simple.t t/Plack-Handler/output_encoding.t t/Plack-Handler/standalone.t t/Plack-Handler/try_mangle.pl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/META.json new/Plack-1.0029/META.json --- old/Plack-1.0028/META.json 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/META.json 2013-08-22 23:05:49.000000000 +0200 @@ -4,7 +4,7 @@ "Tatsuhiko Miyagawa" ], "dynamic_config" : 0, - "generated_by" : "Dist::Milla version v1.0.2, Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.131560", + "generated_by" : "Dist::Milla version v1.0.3, Dist::Zilla version 4.300035, CPAN::Meta::Converter version 2.132140", "license" : [ "perl_5" ], @@ -44,11 +44,11 @@ "Filesys::Notify::Simple" : "0", "HTTP::Body" : "1.06", "HTTP::Message" : "5.814", - "HTTP::Tiny" : "0.024", + "HTTP::Tiny" : "0.034", "Hash::MultiValue" : "0.05", "Pod::Usage" : "1.36", "Stream::Buffered" : "0.02", - "Test::TCP" : "1.02", + "Test::TCP" : "2.00", "Try::Tiny" : "0", "URI" : "1.59", "parent" : "0", @@ -78,7 +78,8 @@ "LWP::Protocol::http10" : "0", "LWP::UserAgent" : "5.814", "Log::Log4perl" : "0", - "MIME::Types" : "0" + "MIME::Types" : "0", + "Module::Refresh" : "0" } } }, @@ -94,7 +95,7 @@ "web" : "https://github.com/plack/Plack" } }, - "version" : "1.0028", + "version" : "1.0029", "x_authority" : "cpan:MIYAGAWA", "x_contributors" : [ "Aaron Trevena <[email protected]>", @@ -121,6 +122,7 @@ "Hans Dieter Pearcey <[email protected]>", "Henry Baragar <[email protected]>", "Hiroshi Sakai <[email protected]>", + "Jakob Voss <[email protected]>", "Jay Hannah <[email protected]>", "Jesse Luehrs <[email protected]>", "Jiro Nishiguchi <[email protected]>", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/META.yml new/Plack-1.0029/META.yml --- old/Plack-1.0028/META.yml 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/META.yml 2013-08-22 23:05:49.000000000 +0200 @@ -9,7 +9,7 @@ ExtUtils::MakeMaker: 6.30 File::ShareDir::Install: 0.03 dynamic_config: 0 -generated_by: 'Dist::Milla version v1.0.2, Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.131560' +generated_by: 'Dist::Milla version v1.0.3, Dist::Zilla version 4.300035, CPAN::Meta::Converter version 2.132140' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -31,11 +31,11 @@ Filesys::Notify::Simple: 0 HTTP::Body: 1.06 HTTP::Message: 5.814 - HTTP::Tiny: 0.024 + HTTP::Tiny: 0.034 Hash::MultiValue: 0.05 Pod::Usage: 1.36 Stream::Buffered: 0.02 - Test::TCP: 1.02 + Test::TCP: 2.00 Try::Tiny: 0 URI: 1.59 parent: 0 @@ -44,7 +44,7 @@ bugtracker: https://github.com/plack/Plack/issues homepage: https://github.com/plack/Plack repository: https://github.com/plack/Plack.git -version: 1.0028 +version: 1.0029 x_authority: cpan:MIYAGAWA x_contributors: - 'Aaron Trevena <[email protected]>' @@ -71,6 +71,7 @@ - 'Hans Dieter Pearcey <[email protected]>' - 'Henry Baragar <[email protected]>' - 'Hiroshi Sakai <[email protected]>' + - 'Jakob Voss <[email protected]>' - 'Jay Hannah <[email protected]>' - 'Jesse Luehrs <[email protected]>' - 'Jiro Nishiguchi <[email protected]>' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/Makefile.PL new/Plack-1.0029/Makefile.PL --- old/Plack-1.0028/Makefile.PL 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/Makefile.PL 2013-08-22 23:05:49.000000000 +0200 @@ -32,11 +32,11 @@ "Filesys::Notify::Simple" => 0, "HTTP::Body" => "1.06", "HTTP::Message" => "5.814", - "HTTP::Tiny" => "0.024", + "HTTP::Tiny" => "0.034", "Hash::MultiValue" => "0.05", "Pod::Usage" => "1.36", "Stream::Buffered" => "0.02", - "Test::TCP" => "1.02", + "Test::TCP" => "2.00", "Try::Tiny" => 0, "URI" => "1.59", "parent" => 0 @@ -45,7 +45,7 @@ "Test::More" => "0.88", "Test::Requires" => 0 }, - "VERSION" => "1.0028", + "VERSION" => "1.0029", "test" => { "TESTS" => "t/*.t t/HTTP-Message-PSGI/*.t t/HTTP-Server-PSGI/*.t t/Plack-Builder/*.t t/Plack-HTTPParser-PP/*.t t/Plack-Handler/*.t t/Plack-Loader/*.t t/Plack-MIME/*.t t/Plack-Middleware/*.t t/Plack-Middleware/cascade/*.t t/Plack-Middleware/recursive/*.t t/Plack-Middleware/stacktrace/*.t t/Plack-Request/*.t t/Plack-Response/*.t t/Plack-Runner/*.t t/Plack-TempBuffer/*.t t/Plack-Test/*.t t/Plack-Util/*.t" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/cpanfile new/Plack-1.0029/cpanfile --- old/Plack-1.0028/cpanfile 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/cpanfile 2013-08-22 23:05:49.000000000 +0200 @@ -9,12 +9,12 @@ requires 'Hash::MultiValue', '0.05'; requires 'Pod::Usage', '1.36'; requires 'Stream::Buffered', '0.02'; -requires 'Test::TCP', '1.02'; +requires 'Test::TCP', '2.00'; requires 'Try::Tiny'; requires 'URI', '1.59'; requires 'parent'; requires 'Apache::LogFormat::Compiler', '0.12'; -requires 'HTTP::Tiny', 0.024; +requires 'HTTP::Tiny', 0.034; on test => sub { requires 'Test::More', '0.88'; @@ -29,6 +29,7 @@ suggests 'HTTP::Server::Simple::PSGI'; suggests 'HTTP::Request::AsCGI'; suggests 'LWP::UserAgent', '5.814'; + suggests 'Module::Refresh'; }; on runtime => sub { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/lib/Plack/Handler/HTTP/Server/Simple.pm new/Plack-1.0029/lib/Plack/Handler/HTTP/Server/Simple.pm --- old/Plack-1.0028/lib/Plack/Handler/HTTP/Server/Simple.pm 2013-06-15 10:42:58.000000000 +0200 +++ new/Plack-1.0029/lib/Plack/Handler/HTTP/Server/Simple.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,61 +0,0 @@ -package Plack::Handler::HTTP::Server::Simple; -use strict; - -sub new { - my($class, %args) = @_; - bless {%args}, $class; -} - -sub run { - my($self, $app) = @_; - - my $server = Plack::Handler::HTTP::Server::Simple::PSGIServer->new($self->{port}); - $server->host($self->{host}) if $self->{host}; - $server->app($app); - $server->{_server_ready} = delete $self->{server_ready} || sub {}; - - $server->run; -} - -package Plack::Handler::HTTP::Server::Simple::PSGIServer; -use parent qw(HTTP::Server::Simple::PSGI); - -sub print_banner { - my $self = shift; - - $self->{_server_ready}->({ - host => $self->host, - port => $self->port, - server_software => 'HTTP::Server::Simple::PSGI', - }); -} - -package Plack::Handler::HTTP::Server::Simple; - -1; - -__END__ - -=head1 NAME - -Plack::Handler::HTTP::Server::Simple - Adapter for HTTP::Server::Simple - -=head1 SYNOPSIS - - plackup -s HTTP::Server::Simple --port 9090 - -=head1 DESCRIPTION - -Plack::Handler::HTTP::Server::Simple is an adapter to run PSGI -applications on L<HTTP::Server::Simple>. - -=head1 SEE ALSO - -L<Plack>, L<HTTP::Server::Simple::PSGI> - -=head1 AUTHOR - -Tatsuhiko Miyagawa - - -=cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/lib/Plack/LWPish.pm new/Plack-1.0029/lib/Plack/LWPish.pm --- old/Plack-1.0028/lib/Plack/LWPish.pm 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/lib/Plack/LWPish.pm 2013-08-22 23:05:49.000000000 +0200 @@ -59,7 +59,7 @@ C<request> that acts like L<LWP::UserAgent>'s request method i.e. takes HTTP::Request object and returns HTTP::Response object. -This module is used solely inside L<PLack::Test::Suite> and +This module is used solely inside L<Plack::Test::Suite> and L<Plack::Test::Server>, and you are recommended to take a look at L<HTTP::Thin> if you would like to use this outside Plack. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/lib/Plack/Request.pm new/Plack-1.0029/lib/Plack/Request.pm --- old/Plack-1.0028/lib/Plack/Request.pm 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/lib/Plack/Request.pm 2013-08-22 23:05:49.000000000 +0200 @@ -2,7 +2,7 @@ use strict; use warnings; use 5.008_001; -our $VERSION = '1.0028'; +our $VERSION = '1.0029'; $VERSION = eval $VERSION; use HTTP::Headers; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/lib/Plack/Response.pm new/Plack-1.0029/lib/Plack/Response.pm --- old/Plack-1.0028/lib/Plack/Response.pm 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/lib/Plack/Response.pm 2013-08-22 23:05:49.000000000 +0200 @@ -1,7 +1,7 @@ package Plack::Response; use strict; use warnings; -our $VERSION = '1.0028'; +our $VERSION = '1.0029'; $VERSION = eval $VERSION; use Plack::Util::Accessor qw(body status); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/lib/Plack/Test/MockHTTP.pm new/Plack-1.0029/lib/Plack/Test/MockHTTP.pm --- old/Plack-1.0028/lib/Plack/Test/MockHTTP.pm 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/lib/Plack/Test/MockHTTP.pm 2013-08-22 23:05:49.000000000 +0200 @@ -8,29 +8,26 @@ use HTTP::Message::PSGI; use Try::Tiny; -sub test_psgi { - my %args = @_; - - my $client = delete $args{client} or croak "client test code needed"; - my $app = delete $args{app} or croak "app needed"; +sub new { + my($class, $app) = @_; + bless { app => $app }, $class; +} - my $cb = sub { - my $req = shift; - $req->uri->scheme('http') unless defined $req->uri->scheme; - $req->uri->host('localhost') unless defined $req->uri->host; - my $env = $req->to_psgi; - - my $res = try { - HTTP::Response->from_psgi($app->($env)); - } catch { - HTTP::Response->from_psgi([ 500, [ 'Content-Type' => 'text/plain' ], [ $_ ] ]); - }; +sub request { + my($self, $req) = @_; - $res->request($req); - return $res; + $req->uri->scheme('http') unless defined $req->uri->scheme; + $req->uri->host('localhost') unless defined $req->uri->host; + my $env = $req->to_psgi; + + my $res = try { + HTTP::Response->from_psgi($self->{app}->($env)); + } catch { + HTTP::Response->from_psgi([ 500, [ 'Content-Type' => 'text/plain' ], [ $_ ] ]); }; - $client->($cb); + $res->request($req); + return $res; } 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/lib/Plack/Test/Server.pm new/Plack-1.0029/lib/Plack/Test/Server.pm --- old/Plack-1.0028/lib/Plack/Test/Server.pm 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/lib/Plack/Test/Server.pm 2013-08-22 23:05:49.000000000 +0200 @@ -8,32 +8,36 @@ use Plack::Loader; use Plack::LWPish; -sub test_psgi { - my %args = @_; +sub new { + my($class, $app, %args) = @_; - my $client = delete $args{client} or croak "client test code needed"; - my $app = delete $args{app} or croak "app needed"; - my $ua = delete $args{ua} || Plack::LWPish->new; - - test_tcp( - client => sub { - my $port = shift; - my $cb = sub { - my $req = shift; - $req->uri->scheme('http'); - $req->uri->host($args{host} || '127.0.0.1'); - $req->uri->port($port); - return $ua->request($req); - }; - $client->($cb); - }, - server => $args{server} || sub { + my $server = Test::TCP->new( + code => sub { my $port = shift; my $server = Plack::Loader->auto(port => $port, host => ($args{host} || '127.0.0.1')); $server->run($app); exit; }, ); + + bless { server => $server, %args }, $class; +} + +sub port { + my $self = shift; + $self->{server}->port; +} + +sub request { + my($self, $req) = @_; + + my $ua = $self->{ua} || Plack::LWPish->new( no_proxy => [qw/127.0.0.1/] ); + + $req->uri->scheme('http'); + $req->uri->host($self->{host} || '127.0.0.1'); + $req->uri->port($self->port); + + return $ua->request($req); } 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/lib/Plack/Test/Suite.pm new/Plack-1.0029/lib/Plack/Test/Suite.pm --- old/Plack-1.0028/lib/Plack/Test/Suite.pm 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/lib/Plack/Test/Suite.pm 2013-08-22 23:05:49.000000000 +0200 @@ -754,8 +754,7 @@ test_tcp( client => sub { my $port = shift; - - my $ua = Plack::LWPish->new; + my $ua = Plack::LWPish->new( no_proxy => [qw/127.0.0.1/] ); for my $i (0..$#TEST) { my $test = $TEST[$i]; note $test->[0]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/lib/Plack/Test.pm new/Plack-1.0029/lib/Plack/Test.pm --- old/Plack-1.0028/lib/Plack/Test.pm 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/lib/Plack/Test.pm 2013-08-22 23:05:49.000000000 +0200 @@ -1,20 +1,41 @@ package Plack::Test; use strict; use warnings; +use Carp; use parent qw(Exporter); our @EXPORT = qw(test_psgi); our $Impl; $Impl ||= $ENV{PLACK_TEST_IMPL} || "MockHTTP"; -sub test_psgi { - eval "require Plack::Test::$Impl;"; +sub create { + my($class, $app, @args) = @_; + + my $subclass = "Plack::Test::$Impl"; + eval "require $subclass"; die $@ if $@; + no strict 'refs'; + if (defined &{"Plack::Test::$Impl\::test_psgi"}) { + return \&{"Plack::Test::$Impl\::test_psgi"}; + } + + $subclass->new($app, @args); +} + +sub test_psgi { if (ref $_[0] && @_ == 2) { @_ = (app => $_[0], client => $_[1]); } - &{"Plack::Test::$Impl\::test_psgi"}(@_); + my %args = @_; + + my $app = delete $args{app}; # Backward compat: some implementations don't need app + my $client = delete $args{client} or Carp::croak "client test code needed"; + + my $tester = Plack::Test->create($app, %args); + return $tester->(@_) if ref $tester eq 'CODE'; # compatibility + + $client->(sub { $tester->request(@_) }); } 1; @@ -28,8 +49,16 @@ =head1 SYNOPSIS use Plack::Test; + use HTTP::Request::Common; + + # Simple OO interface + my $app = sub { return [ 200, [], [ "Hello "] ] }; + my $test = Plack::Test->create($app); + + my $res = $test->request(GET "/"); + is $res->content, "Hello"; - # named params + # traditional - named params test_psgi app => sub { my $env = shift; @@ -42,16 +71,13 @@ like $res->content, qr/Hello World/; }; - use HTTP::Request::Common; - - # positional params (app, client) - my $app = sub { return [ 200, [], [ "Hello "] ] }; - test_psgi $app, sub { - my $cb = shift; - my $res = $cb->(GET "/"); - is $res->content, "Hello"; - }; - + # positional params (app, client) + my $app = sub { return [ 200, [], [ "Hello "] ] }; + test_psgi $app, sub { + my $cb = shift; + my $res = $cb->(GET "/"); + is $res->content, "Hello"; + }; =head1 DESCRIPTION @@ -61,8 +87,32 @@ but you may also use any L<Plack::Handler> implementation to run live HTTP requests against a web server. +=head1 METHODS + +=over 4 + +=item create + + $test = Plack::Test->create($app, %options); + +creates an instance of Plack::Test implementation class. C<$app> has +to be a valid PSGI application code reference. + +=item request + + $res = $test->request($request); + +takes an HTTP::Request object, runs it through the PSGI application to +test and returns an HTTP::Response object. + +=back + =head1 FUNCTIONS +Plack::Test also provides a functional interface that takes two +callbacks, each of which represents PSGI application and HTTP client +code that tests the application. + =over 4 =item test_psgi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/lib/Plack.pm new/Plack-1.0029/lib/Plack.pm --- old/Plack-1.0028/lib/Plack.pm 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/lib/Plack.pm 2013-08-22 23:05:49.000000000 +0200 @@ -3,7 +3,7 @@ use strict; use warnings; use 5.008_001; -our $VERSION = '1.0028'; +our $VERSION = '1.0029'; $VERSION = eval $VERSION; 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/t/Plack-Handler/http_server_simple.t new/Plack-1.0029/t/Plack-Handler/http_server_simple.t --- old/Plack-1.0028/t/Plack-Handler/http_server_simple.t 2013-06-15 10:42:58.000000000 +0200 +++ new/Plack-1.0029/t/Plack-Handler/http_server_simple.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -use strict; -use warnings; -use Test::More; -use Test::Requires { 'HTTP::Server::Simple::PSGI' => 0.11 }; -use Plack::Test::Suite; - -Plack::Test::Suite->run_server_tests('HTTP::Server::Simple'); -done_testing(); - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Plack-1.0028/t/Plack-Loader/restarter.t new/Plack-1.0029/t/Plack-Loader/restarter.t --- old/Plack-1.0028/t/Plack-Loader/restarter.t 2013-06-15 10:42:57.000000000 +0200 +++ new/Plack-1.0029/t/Plack-Loader/restarter.t 2013-08-22 23:05:49.000000000 +0200 @@ -5,7 +5,7 @@ use HTTP::Request::Common; use Plack::Loader::Restarter; -plan skip_all => "release test only" unless $ENV{RELEASE_TESTING}; +plan skip_all => "release test only" unless $ENV{AUTHOR_TESTING}; my @return_bodies = ('Hi first', 'Hi second', 'Hi third'); my @restartertestfiles = ('t/restartertestfile1.pl', 't/restartertestfile2.pl'); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
