Skip Menu |

This queue is for tickets about the RPC-JSON CPAN distribution.

Report information
The Basics
Id: 27229
Status: resolved
Priority: 0/
Queue: RPC-JSON

People
Owner: chris [...] carline.org
Requestors: stennie [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.11



Subject: t/02connect test cases unexpectedly pass; Can't connect to "www.simplymapped.com"
The test cases in t/02connect.t unexpectedly pass even though www.simplymapped.com cannot currently be found in the DNS: t/02connect........ok 1/4Can't load http://www.simplymapped.com/services/geocode/ json.smd: 500 Can't connect to www.simplymapped.com:80 (Bad hostname 'www.simplymapped.com') at t/02connect.t line 9 t/02connect........ok 2/4Can't load http://www.simplymapped.com/services/geocode/ json.smd: 500 Can't connect to www.simplymapped.com:80 (Bad hostname 'www.simplymapped.com') at t/02connect.t line 13 t/02connect........ok 3/4Can't load http://www.simplymapped.com/services/geocode/ json.smd: 500 Can't connect to www.simplymapped.com:80 (Bad hostname 'www.simplymapped.com') at t/02connect.t line 17 t/02connect........ok This is because RPC::JSON->new() always returns an object, which stringifies to pass the test case: ok($jsonrpc2, "Creating RPC::JSON object with hash"); Suggested fix (aside from having a valid hostname in the test cases): --- lib/RPC/JSON.pm.dist 2006-08-20 23:37:37.000000000 +1000 +++ lib/RPC/JSON.pm 2007-05-22 07:36:18.000000000 +1000 @@ -134,7 +134,7 @@ unless ( $self->{dont_connect} ) { # If we fail to connect, it will alert the user but we shouldn't cancel # the object (or maybe we should if it is a 40* error?) - $self->connect; + return unless $self->connect; } return $self; } Cheers, Stephen
Updated tests to point to a new JSON endpoint.