diff --git a/t/write_cache.pl b/t/write_cache.pl index b92fd15..94e959b 100644 --- a/t/write_cache.pl +++ b/t/write_cache.pl @@ -8,7 +8,9 @@ eval { require 'ddclient'; } or BAIL_OUT($@); my $warning; my $module = Test::MockModule->new('ddclient'); -$module->redefine('warning', sub { +# Note: 'mock' is used instead of 'redefine' because 'redefine' is not available in the versions of +# Test::MockModule distributed with old Debian and Ubuntu releases. +$module->mock('warning', sub { BAIL_OUT("warning already logged") if defined($warning); $warning = sprintf(shift, @_); });