Skip to content

Commit

Permalink
rename module. Refer to HTTP::Thin for the use outside Plack
Browse files Browse the repository at this point in the history
  • Loading branch information
miyagawa committed Jun 13, 2013
1 parent 88467a8 commit 6b2dec5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
29 changes: 8 additions & 21 deletions lib/HTTP/Tiny/LWPLike.pm → lib/Plack/LWPish.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package HTTP::Tiny::LWPLike;
package Plack::LWPish;
use strict;
use warnings;
use HTTP::Tiny;
Expand Down Expand Up @@ -42,15 +42,15 @@ __END__
=head1 NAME
HTTP::Tiny::LWPLike - HTTP::Request/Response compatible interface with HTTP::Tiny backend
Plack::LWPish - HTTP::Request/Response compatible interface with HTTP::Tiny backend
=head1 SYNOPSIS
use HTTP::Tiny::LWPLike;
use Plack::LWPish;
my $request = HTTP::Request->new(GET => 'http://perl.com/');
my $ua = HTTP::Tiny::LWPLike->new;
my $ua = Plack::LWPish->new;
my $res = $ua->request($request); # returns HTTP::Response
=head1 DESCRIPTION
Expand All @@ -59,22 +59,9 @@ This module is an adapter object that implements one method,
C<request> that acts like L<LWP::UserAgent>'s request method
i.e. takes HTTP::Request object and returns HTTP::Response object.
=head1 INCOMPATIBILITIES
=over 4
=item *
SSL is not supported unless required modules are installed.
=item *
authentication is not handled via the UA methods. You can encode the
C<Authorization> headers in the C<$request> by yourself.
=cut
There might be more - see L<HTTP::Tiny> for the details.
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.
=back
Expand All @@ -84,6 +71,6 @@ Tatsuhiko Miyagawa
=head1 SEE ALSO
L<HTTP::Tiny> L<LWP::UserAgent>
L<HTTP::Thin> L<HTTP::Tiny> L<LWP::UserAgent>
=cut
4 changes: 2 additions & 2 deletions lib/Plack/Test/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ use HTTP::Request;
use HTTP::Response;
use Test::TCP;
use Plack::Loader;
use HTTP::Tiny::LWPLike;
use Plack::LWPish;

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";
my $ua = delete $args{ua} || HTTP::Tiny::LWPLike->new;
my $ua = delete $args{ua} || Plack::LWPish->new;

test_tcp(
client => sub {
Expand Down
4 changes: 2 additions & 2 deletions lib/Plack/Test/Suite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use Plack::Middleware::Lint;
use Plack::Util;
use Plack::Request;
use Try::Tiny;
use HTTP::Tiny::LWPLike;
use Plack::LWPish;

my $share_dir = try { File::ShareDir::dist_dir('Plack') } || 'share';

Expand Down Expand Up @@ -755,7 +755,7 @@ sub run_server_tests {
client => sub {
my $port = shift;

my $ua = HTTP::Tiny::LWPLike->new;
my $ua = Plack::LWPish->new;
for my $i (0..$#TEST) {
my $test = $TEST[$i];
note $test->[0];
Expand Down

0 comments on commit 6b2dec5

Please sign in to comment.