Subject: | Ping timeout parameter |
This is very minor...
The documentation says "The optional timeout must be greater than 0 seconds and defaults to whatever was specified when the ping object was created."
The code says:
$timeout = $self->{"timeout"} unless $timeout;
croak("Timeout must be greater than 0 seconds") if $timeout <= 0;
If we pass a timeout of 0, it uses the default and only throws an exception if we pass a negative value.
The most obvious fix is to change that to:
$timeout = $self->{"timeout"} unless defined $timeout;
croak("Timeout must be greater than 0 seconds") if $timeout <= 0;
(I only found because I was expanding the test suite for Mock::Net::Ping.)