Skip to content

Commit

Permalink
Revert "Add HTTP::Tiny interface for LWP replacement in tests"
Browse files Browse the repository at this point in the history
This reverts commit e06c942.
  • Loading branch information
miyagawa committed Jun 12, 2013
1 parent e06c942 commit 4629793
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 126 deletions.
1 change: 0 additions & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ requires 'Try::Tiny';
requires 'URI', '1.59';
requires 'parent';
requires 'Apache::LogFormat::Compiler', '0.12';
requires 'HTTP::Tiny', 0.024;

on test => sub {
requires 'Test::More', '0.88';
Expand Down
119 changes: 0 additions & 119 deletions lib/HTTP/Tiny/LWPLike.pm

This file was deleted.

8 changes: 4 additions & 4 deletions lib/Plack/Test/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ package Plack::Test::Server;
use strict;
use warnings;
use Carp;
use HTTP::Request;
use HTTP::Response;
use Test::TCP;
use Plack::Loader;
use HTTP::Tiny::LWPLike;
use Test::Requires ();

sub test_psgi {
my %args = @_;

Test::Requires::test_requires('LWP::UserAgent');

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} || LWP::UserAgent->new;

test_tcp(
client => sub {
Expand Down
6 changes: 4 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 Test::Requires ();

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

Expand Down Expand Up @@ -741,6 +741,8 @@ sub runtests {
sub run_server_tests {
my($class, $server, $server_port, $http_port, %args) = @_;

Test::Requires::test_requires('LWP::UserAgent');

if (ref $server ne 'CODE') {
my $server_class = $server;
$server = sub {
Expand All @@ -755,7 +757,7 @@ sub run_server_tests {
client => sub {
my $port = shift;

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

0 comments on commit 4629793

Please sign in to comment.