Test::Builder2::Mouse::Exporter - make an import() and unimport() just like Test/Builder2/Mouse.pm
This document describes Mouse version 0.53
package MyApp::Mouse; use Test::Builder2::Mouse (); use Test::Builder2::Mouse::Exporter; Test::Builder2::Mouse::Exporter->setup_import_methods( as_is => [ 'has_rw', 'other_sugar', \&Some::Random::thing ], also => 'Mouse', ); sub has_rw { my $meta = caller->meta; my ( $name, %options ) = @_; $meta->add_attribute( $name, is => 'rw', %options, ); } # then later ... package MyApp::User; use MyApp::Mouse; has 'name'; has_rw 'size'; thing; no MyApp::Mouse;
This module encapsulates the exporting of sugar functions in a Test/Builder2/Mouse.pm-like manner. It does this by building custom import, unimport methods for your module, based on a spec you provide.
Test/Builder2/Mouse.pm
import
unimport
Note that Test::Builder2::Mouse::Exporter does not provide the with_meta option, but you can easily get the metaclass by caller->meta as "SYNOPSIS" shows.
Test::Builder2::Mouse::Exporter
with_meta
caller->meta
setup_import_methods( ARGS )
build_import_methods( ARGS ) -> (\&import, \&unimport)
Moose::Exporter
To install Test::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Simple
CPAN shell
perl -MCPAN -e shell install Test::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.