Acme-Teddy
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Acme/Teddy.pm view on Meta::CPAN
# Your target code here.
}
package main;
use Acme::Teddy;
use Test::Your::Testing::Module;
# Your test here.
Start a test script with a bare block in AT (or subclass it). Then define
whatever behavior you like. After you switch into "your own" package, test
for that behavior. You should be able to verify by eye that your expectations
are correct; therefore, you can concentrate on debugging your testing module.
Writing the bare block is just like writing a module, except that much of the
dull work is done for you.
Lexical declarations will "leak" across package boundaries if you leave off
the bare block; so don't do that. It does not seem to be necessary to make
this a C<BEGIN> block; if you find any counterexample, please contact author.
Import whatever you like when you C<use Acme::Teddy>.
Be sure to define it, whatever it is.
AT will attempt to export to caller I<everything> you request.
You don't have to import anything.
You can invoke a function (that you defined) with:
my $return = Acme::Teddy::my_button_nose();
Or invoke a method:
$bear->talk();
Don't forget to define that method!
=head1 DIAGNOSTICS
=over
=item $pkg: Can't export symbol: $type$sym
You tried to import something bizarre. Check your C<use()> line.
Rationally, you can only export I<symbols> from one package to another.
These can be barewords, which will be interpreted as subroutines;
scalar, array, or hash variables; coderefs; or typeglobs.
=back
=head1 CONFIGURATION AND ENVIRONMENT
Acme::Teddy requires no configuration files or environment variables.
=head1 DEPENDENCIES
No dependencies.
=head1 INCOMPATIBILITIES
None.
=head1 BUGS AND LIMITATIONS
You really do have to define stuff yourself or it does nothing.
Lexical variables aren't found in package symbol tables.
=head1 THANKS
=over
=item *
B<james2vegas> of L<PerlMonks|http://perlmonks.org/>
for improvements in the test script.
=back
=head1 AUTHOR
Xiong Changnian C<< <xiong@cpan.org> >>
=head1 LICENSE
Copyright (C) 2010 Xiong Changnian C<< <xiong@cpan.org> >>
This library and its contents are released under Artistic License 2.0:
L<http://www.opensource.org/licenses/artistic-license-2.0.php>
=cut
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.791 second using v1.00-cache-2.02-grep-82fe00e-cpan-dad7e4baca0 )