Skip to content

Commit

Permalink
do not use Test::MockObject, Test::MockObject makes some trouble on c…
Browse files Browse the repository at this point in the history
…pan testers
  • Loading branch information
tokuhirom committed Dec 31, 2009
1 parent e7dd36c commit 64e634c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
5 changes: 2 additions & 3 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ requires 'Exporter' => 5.58;
requires 'HTTP::Request' => 1.40;
requires 'URI' => 1.36;

build_requires 'Test::More';
build_requires 'YAML';
build_requires 'Test::MockObject';
test_requires 'Test::More';
test_requires 'YAML';
auto_set_repository;
use_test_base;
auto_include;
Expand Down
4 changes: 2 additions & 2 deletions t/01_simple.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Test::Base;
use YAML;
use HTTPx::Dispatcher::Declare;
use HTTP::Request;
use Test::MockObject;
use t::MockAPREQ;

plan tests => 2*blocks;

Expand All @@ -28,7 +28,7 @@ sub _apache_req {
my $block = shift;
my $method = $block->method || 'GET';
(my $uri = $block->uri) =~ s/\?.+//;
Test::MockObject->new({})->set_always('uri' => $uri)->set_always( method => $method);
t::MockAPREQ->new(uri => $uri, method => $method);
}

sub _http_req {
Expand Down
4 changes: 2 additions & 2 deletions t/03_templates.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Test::Base;
use YAML;
use HTTPx::Dispatcher::Declare;
use HTTP::Request;
use Test::MockObject;
use t::MockAPREQ;

plan tests => 2*blocks;

Expand All @@ -28,7 +28,7 @@ sub _apache_req {
my $block = shift;
my $method = $block->method || 'GET';
(my $uri = $block->uri) =~ s/\?.+//;
Test::MockObject->new({})->set_always('uri' => $uri)->set_always( method => $method);
t::MockAPREQ->new(uri => $uri, method => $method);
}

sub _http_req {
Expand Down
9 changes: 9 additions & 0 deletions t/MockAPREQ.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package t::MockAPREQ; # mock object for Apache::Request
use strict;
use warnings;

sub new { my $class = shift; bless {@_}, $class; }
sub uri { $_[0]->{uri} }
sub method { $_[0]->{method} }

1;

0 comments on commit 64e634c

Please sign in to comment.