use Sub::Exporter;
use Test::Builder;
-our $VERSION = '0.01';
+use Moose::Util 'does_role', 'find_meta';
+
+our $VERSION = '0.66';
+$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
my @exports = qw[
groups => { default => \@exports }
});
-my $Test = Test::Builder->new;
-
-## some helpers ...
+## the test builder instance ...
-sub _get_meta {
- return unless $_[0];
- return Class::MOP::get_metaclass_by_name(ref($_[0]) || $_[0]);
-}
+my $Test = Test::Builder->new;
## exported functions
$message ||= "The object has a meta";
- if (_get_meta($class_or_obj)) {
+ if (find_meta($class_or_obj)) {
return $Test->ok(1, $message)
}
else {
$message ||= "The object does $does";
- my $meta = _get_meta($class_or_obj);
-
- if ($meta->does_role($does)) {
+ if (does_role($class_or_obj, $does)) {
return $Test->ok(1, $message)
}
else {
$message ||= "The object does has an attribute named $attr_name";
- my $meta = _get_meta($class_or_obj);
+ my $meta = find_meta($class_or_obj);
if ($meta->find_attribute_by_name($attr_name)) {
return $Test->ok(1, $message)
=head1 COPYRIGHT AND LICENSE
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2009 by Infinity Interactive, Inc.
L<http://www.iinteractive.com>