Subject: | Documenation incorrect: "The following statements are equivalent:..." |
Test::MockModule, v0.05, Perl version 5.8.7, Linux 2.6, Debian 'stable'/'testing' mix.
The manpage says
-- quote --
The following statements are equivalent:
[...]
$module->mock(updated => [localtime()]);
$module->mock(updated => sub { return [localtime()]});
-- endquote --
That's not true. Using
updated => [localtime()]
will return the same array reference every time you call it (and the same values for localtime), whereas using
sub { [localtime()] }
will return a different array reference each time, and moreover will return the current time each time you call it.
-- Larry Clapp
larry@theclapp.org