PrePAN

Sign in to PrePAN

Test::Import Test that your module forces other things into the calling namespace

Good

Synopsis

use Test::Import;

# Ensure our base module imports strict
does_import_strict 'My::Base';

# Ensure our base module imports warnings
does_import_warnings 'My::Base';

# Ensure our base module imports a feature(s)
does_import_feature 'My::Base', 'say', 'switch';
# XXX: 5.10.0 feature.pm doesn't allow us to verify feature bundles, but the latest version does... might have to figure out which version this changes and try to work through things accordingly...

# Ensure our base module imports a sub from another module
does_import_sub 'My::Base', 'Scalar::Util', 'blessed';

# Ensure our base module loads a class
does_import_class 'My::Base', 'Test::MockObject';

Description

This module encapsulates a bunch of tests for testing base or boilerplate modules (e.g. modules that use Import::Into to force things into the calling namespace). These tests ensure that the base module imports what it says it imports.

Comments

Please sign up to post a review.