perl-Test-Spec icon indicating copy to clipboard operation
perl-Test-Spec copied to clipboard

Have a mechanism to setup Test::Trap layers and strategies

Open drmuey opened this issue 6 years ago • 1 comments

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)

drmuey avatar Jul 11 '19 21:07 drmuey

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

drmuey avatar Jul 29 '19 19:07 drmuey