tadam/Test-Mock-LWP-Dispatch — pull request #2 by ashb (2013-05-16 11:04:27+00:00)
Title: Mocking doens't work if you call `get` instead of `simple_request`

So the code I'm testing does `$ua->get` and as it stands currently this dist just yields a warning of `Un-mocked method 'get()' called` instead of checking the map.

A simple example that I'd expect to work:

```perl
use strictures 1;
use Test::More;
use Test::Mock::LWP::Dispatch;

my $url = "http://example.com/a";
$mock_ua->map( $url, HTTP::Response->new(200, 'OK', [], '

Hi!

') );

is 200, $mock_ua->get( $url )->code;
done_testing;
```

Should this work and I've just done something wrong? A look at the code and Test::MockObject appears not.

However using Test::MockObject::Extends instead looks like it will solve all this for us, for example this behaves as expected:

```perl
use strictures 1;
use Test::More;
use Test::MockObject::Extends;
use Test::Mock::LWP::Dispatch;

my $mock_ua = Test::MockObject::Extends->new("LWP::UserAgent");
$mock_ua->mock( simple_request => Test::Mock::LWP::Dispatch->can('simple_request') );
$mock_ua->mock( map => Test::Mock::LWP::Dispatch->can('map') );

my $url = "http://example.com/a";
$mock_ua->map( $url, HTTP::Response->new(200, 'OK', [], '

Hi!

') );

is 200, $mock_ua->get( $url )->code;
done_testing;
```

Any reason not to use ::Extends instead? If you are open to this I'll create a pull request tomorrow that switches over to using this approach.