Kent Fredric > Test-StructuredObject-0.01000010 > Test::StructuredObject::CodeStub

Download:
Test-StructuredObject-0.01000010.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.01000010   Source  

NAME ^

Test::StructuredObject::CodeStub - The base class of all executable tests.

VERSION ^

version 0.01000010

DESCRIPTION ^

This class is basically a functor. At least, all derived packages are. This top level class has no implicit code storage part, and this module really should be reimplemented as a role. But laziness.

This top level provides few basic utilities to inheriting packages, largely dcode , run and to_s.

METHODS ^

dcode

Return the source-code of this objects coderef using B::Deparse. Will not work on the base class as it needs ->code to work.

run

Execute this objects coderef inside an eval { } block.

In the event of a failure emanating from the eval'd code, that error is passed to carp

Return value of the coderef is passed to the caller.

Will not work on the base class as it needs ->code to work.

to_s

Pretty-print this object in a serialisation-like format showing the source for the coderef.

Will not work on the base class as it needs ->dcode and thus ->code to work.

AUTHOR ^

Kent Fredric <kentnl@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2013 by Kent Fredric <kentnl@cpan.org>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: