NAME
classes::Test - functions to help with classes pragma testing
SYNOPSIS
can_new
can_set_get
has_decl
has_class_const
has_mixins
has_mixins_hash
is_classes MyClass;
is_classes main;
is_throwable X::Mine;
is_classes_exc X::Mine;
DESCRIPTION
Generic tests based on Test::Builder designed to help write unit tests for code that uses the classes
pragma.
FUNCTIONS
Most of the functions that accept a class argument will accept an object argument in place of the class and will look up the class of that object to use.
- can_new
-
Class has a required
new
constructor method. - can_set_get
-
Class has the
set
andget
public attribute accessor dispatch methods defined as well as the private_set
and_get
pair for internal use. - has_decl
-
Class has the DECL declaration method and hash ref defined.
- has_class_const
-
Class has the CLASS constant and method defined.
- has_mixins
-
Class has the MIXIN method defined.
- has_mixins_hash
-
Class has the MIXIN method defined and it is a
HASH
ref. - is_classes
-
Class is a class created or compatible with
classes
. - is_throwable
-
Class fulfills the classes::Throwable interface.
- is_classes_exc
-
Class fulfills the classes::Exception interface.