1 package Test::Object::Test;
16 #####################################################################
17 # Constructor and Accessors
21 my $self = bless { @_ }, $class;
24 unless ( _CLASS($self->class) ) {
25 Carp::croak("Did not provide a valid test class");
27 unless ( _CODELIKE($self->code) ) {
28 Carp::croak("Did not provide a valid CODE or callable object");
50 #####################################################################
54 $_[0]->code->( $_[1] );
61 #####################################################################
64 # Stolen from Params::Util to avoid adding a dependency needlessly
67 (defined $_[0] and ! ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*$/s) ? $_[0] : undef;
71 (Scalar::Util::reftype($_[0])||'') eq 'CODE'
73 Scalar::Util::blessed($_[0]) and overload::Method($_[0],'&{}')