Bug 28615: (follow-up) Disable strict mode explicitly
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 29 Jun 2021 15:24:52 +0000 (12:24 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 29 Jun 2021 15:24:55 +0000 (12:24 -0300)
commitd5a792ddf5970205b38cf20231f1a249318730f3
tree1538892ea95eba33008fef8e280f90999e6c225f
parentec382b926ce238f4d19675ae12fd41016cca8584
Bug 28615: (follow-up) Disable strict mode explicitly

So Debian 9's version of Test::MockModule doens't have ->redefine, and
Ubuntu 20.04's doesn't recognise qw(nostrict). So the only solution is
to just remove the keywords use completely and move back to using
->mock, as the rest of the codebase.

FIXME: using ->mock might be hiding some errors (like a method not being
defined/removed) and should be avoided. ->redefine will explode if the
method doesn't already exist, which is what we want, to catch this kind
of errors. That's why ->mock in strict mode is forbidden. We should try
packaging a newer Test::MockModule ourselves.

Tested on master-buster, master-stretch and master-focal.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
t/lib/Mocks/Logger.pm