summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-11-05 16:25:34 +0100
committerfranck cuny <franck@lumberjaph.net>2010-11-05 16:25:34 +0100
commit831c4e751538e2c1ea2d83cf85f0778d18176d9c (patch)
tree69470d8eac8ea6b580b368feec41db35bf9d322c
parentremove two methods (diff)
downloadnet-http-spore-831c4e751538e2c1ea2d83cf85f0778d18176d9c.tar.gz
mock call finalize
-rw-r--r--lib/Net/HTTP/Spore/Middleware/Mock.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Net/HTTP/Spore/Middleware/Mock.pm b/lib/Net/HTTP/Spore/Middleware/Mock.pm
index 12568bf..d51ab5f 100644
--- a/lib/Net/HTTP/Spore/Middleware/Mock.pm
+++ b/lib/Net/HTTP/Spore/Middleware/Mock.pm
@@ -10,8 +10,9 @@ has tests => ( isa => 'HashRef', is => 'ro', required => 1 );
 sub call {
     my ( $self, $req ) = @_;
 
+    my $finalized_request = $req->finalize;
     foreach my $r ( keys %{ $self->tests } ) {
-        next unless $r eq $req->path;
+        next unless $r eq $finalized_request->uri->path;
         my $res = $self->tests->{$r}->($req);
         return $res if defined $res;
     }