perl-Test-Spec
perl-Test-Spec copied to clipboard
Have a mechanism to setup Test::Trap layers and strategies
Test::Trap has layers and strategies that can be employed upon use.
It’d be awesome if that could could passed through to Test::Spec’s bringing in of Test::Trap
One immediate use case is to set :output(perlio) so that “small” tests that are restricted to not touching disk via things like Test::MockFile could still use Test::Spec (because otherwise Test::Trap uses temp files)
The work around we can do in the meantime to keep Test::Spec tests “small” is this:
use Test::Spec; # trap() goes to FS
BEGIN { delete $::{"trap"}; } # remove that trap()
use Test::Trap ":output(perlio)"; # new trap() goes to memory, and no `redefined` warnings