Import tests for attribute from Mouse's tests
[gitmo/Mouse.git] / t / lib / Test / Mouse.pm
index a538ec3..e654cdf 100644 (file)
@@ -30,7 +30,7 @@ sub does_ok ($$;$) {
     }
     $message ||= "The object does $does";
 
-    if (does_ok($class_or_obj)) {
+    if (does_role($class_or_obj, $does)) {
         return __PACKAGE__->builder->ok(1, $message)
     }
     else {
@@ -55,6 +55,20 @@ sub has_attribute_ok ($$;$) {
 
 # Moose compatible methods/functions
 
+package Mouse::Meta::Module;
+
+sub version   { no strict 'refs'; ${shift->name.'::VERSION'}   }
+sub authority { no strict 'refs'; ${shift->name.'::AUTHORITY'} }
+sub identifier {
+    my $self = shift;
+    return join '-' => (
+       $self->name,
+        ($self->version   || ()),
+        ($self->authority || ()),
+    );
+}
+
+
 package Mouse::Util::TypeConstraints;
 
 use Mouse::Util::TypeConstraints ();
@@ -63,7 +77,7 @@ sub export_type_constraints_as_functions { # TEST ONLY
     my $into = caller;
 
     foreach my $type( list_all_type_constraints() ) {
-        my $tc = find_type_constraint($type)->{_compiled_type_constraint};
+        my $tc = find_type_constraint($type)->_compiled_type_constraint;
         my $as = $into . '::' . $type;
 
         no strict 'refs';
@@ -72,6 +86,14 @@ sub export_type_constraints_as_functions { # TEST ONLY
     return;
 }
 
+package Mouse::Meta::Attribute;
+
+sub applied_traits{            $_[0]->{traits} } # TEST ONLY
+sub has_applied_traits{ exists $_[0]->{traits} } # TEST ONLY
+
+sub has_documentation{ exists $_[0]->{documentation} } # TEST ONLY
+sub documentation{            $_[0]->{documentation} } # TEST ONLY
+
 1;
 
 __END__