bump version to 0.75_01
[gitmo/Moose.git] / lib / Test / Moose.pm
index 58b7e95..4489fb6 100644 (file)
@@ -6,7 +6,10 @@ use warnings;
 use Sub::Exporter;
 use Test::Builder;
 
-our $VERSION   = '0.01';
+use Moose::Util 'does_role', 'find_meta';
+
+our $VERSION   = '0.75_01';
+$VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
 my @exports = qw[
@@ -20,14 +23,9 @@ Sub::Exporter::setup_exporter({
     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
 
@@ -36,7 +34,7 @@ sub meta_ok ($;$) {
     
     $message ||= "The object has a meta";
     
-    if (_get_meta($class_or_obj)) {
+    if (find_meta($class_or_obj)) {
         return $Test->ok(1, $message)
     }
     else {
@@ -49,9 +47,7 @@ sub does_ok ($$;$) {
     
     $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 {
@@ -64,7 +60,7 @@ sub has_attribute_ok ($$;$) {
     
     $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)
@@ -162,7 +158,7 @@ Stevan Little E<lt>stevan@iinteractive.comE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2007 by Infinity Interactive, Inc.
+Copyright 2007-2009 by Infinity Interactive, Inc.
 
 L<http://www.iinteractive.com>