-#!/usr/bin/perl\r
-\r
-use strict;\r
-use warnings;\r
-\r
-use Test::More tests => 8;\r
-\r
-BEGIN {\r
- use_ok('Mouse::Util', ':all');\r
-}\r
-\r
-{\r
- package Foo;\r
-\r
- use Mouse::Role;\r
-}\r
-\r
-{\r
- package Bar;\r
-\r
- use Mouse;\r
-\r
- with qw/Foo/;\r
-}\r
-\r
-{\r
- package Baz;\r
-\r
- use Mouse;\r
-}\r
-\r
-{\r
- package Quux;\r
-\r
- use metaclass;\r
-}\r
-\r
-{\r
- package Foo::Foo;\r
-\r
- use Mouse::Role;\r
-\r
- with 'Foo';\r
-}\r
-\r
-# Classes\r
-\r
-ok(does_role('Bar', 'Foo'), '... Bar does Foo');\r
-\r
-ok(!does_role('Baz', 'Foo'), '... Baz doesnt do Foo');\r
-\r
-# Objects\r
-\r
-my $bar = Bar->new;\r
-\r
-ok(does_role($bar, 'Foo'), '... $bar does Foo');\r
-\r
-my $baz = Baz->new;\r
-\r
-ok(!does_role($baz, 'Foo'), '... $baz doesnt do Foo');\r
-\r
-# Invalid values\r
-\r
-ok(!does_role(undef,'Foo'), '... undef doesnt do Foo');\r
-\r
-ok(!does_role(1,'Foo'), '... 1 doesnt do Foo');\r
-\r
-# non Mouse metaclass\r
-\r
-ok(!does_role('Quux', 'Foo'), '... Quux doesnt do Foo (does not die tho)');\r
-\r
-# TODO: make the below work, maybe?\r
-\r
-# Self\r
-\r
-#ok(does_role('Foo', 'Foo'), '... Foo does do Foo');\r
-\r
-# sub-Roles\r
-\r
-#ok(does_role('Foo::Foo', 'Foo'), '... Foo::Foo does do Foo');\r
-\r
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 8;
+
+BEGIN {
+ use_ok('Mouse::Util', ':all');
+}
+
+{
+ package Foo;
+
+ use Mouse::Role;
+}
+
+{
+ package Bar;
+
+ use Mouse;
+
+ with qw/Foo/;
+}
+
+{
+ package Baz;
+
+ use Mouse;
+}
+
+{
+ package Quux;
+
+ use metaclass;
+}
+
+{
+ package Foo::Foo;
+
+ use Mouse::Role;
+
+ with 'Foo';
+}
+
+# Classes
+
+ok(does_role('Bar', 'Foo'), '... Bar does Foo');
+
+ok(!does_role('Baz', 'Foo'), '... Baz doesnt do Foo');
+
+# Objects
+
+my $bar = Bar->new;
+
+ok(does_role($bar, 'Foo'), '... $bar does Foo');
+
+my $baz = Baz->new;
+
+ok(!does_role($baz, 'Foo'), '... $baz doesnt do Foo');
+
+# Invalid values
+
+ok(!does_role(undef,'Foo'), '... undef doesnt do Foo');
+
+ok(!does_role(1,'Foo'), '... 1 doesnt do Foo');
+
+# non Mouse metaclass
+
+ok(!does_role('Quux', 'Foo'), '... Quux doesnt do Foo (does not die tho)');
+
+# TODO: make the below work, maybe?
+
+# Self
+
+#ok(does_role('Foo', 'Foo'), '... Foo does do Foo');
+
+# sub-Roles
+
+#ok(does_role('Foo::Foo', 'Foo'), '... Foo::Foo does do Foo');
+
-package Test::Mouse;\r
-\r
-use strict;\r
-use warnings;\r
-use Carp qw(croak);\r
-use Mouse::Util qw(find_meta does_role);\r
-\r
-use base qw(Test::Builder::Module);\r
-\r
-our @EXPORT = qw(meta_ok does_ok has_attribute_ok);\r
-\r
-sub meta_ok ($;$) {\r
- my ($class_or_obj, $message) = @_;\r
-\r
- $message ||= "The object has a meta";\r
-\r
- if (find_meta($class_or_obj)) {\r
- return __PACKAGE__->builder->ok(1, $message)\r
- }\r
- else {\r
- return __PACKAGE__->builder->ok(0, $message);\r
- }\r
-}\r
-\r
-sub does_ok ($$;$) {\r
- my ($class_or_obj, $does, $message) = @_;\r
-\r
- if(!defined $does){\r
- croak "You must pass a role name";\r
- }\r
- $message ||= "The object does $does";\r
-\r
- if (does_ok($class_or_obj)) {\r
- return __PACKAGE__->builder->ok(1, $message)\r
- }\r
- else {\r
- return __PACKAGE__->builder->ok(0, $message);\r
- }\r
-}\r
-\r
-sub has_attribute_ok ($$;$) {\r
- my ($class_or_obj, $attr_name, $message) = @_;\r
-\r
- $message ||= "The object does has an attribute named $attr_name";\r
-\r
- my $meta = find_meta($class_or_obj);\r
-\r
- if ($meta->find_attribute_by_name($attr_name)) {\r
- return __PACKAGE__->builder->ok(1, $message)\r
- }\r
- else {\r
- return __PACKAGE__->builder->ok(0, $message);\r
- }\r
-}\r
-\r
-1;\r
-\r
-__END__\r
-\r
-=pod\r
-\r
-=head1 NAME\r
-\r
-Test::Mouse - Test functions for Mouse specific features\r
-\r
-=head1 SYNOPSIS\r
-\r
- use Test::More plan => 1;\r
- use Test::Mouse;\r
-\r
- meta_ok($class_or_obj, "... Foo has a ->meta");\r
- does_ok($class_or_obj, $role, "... Foo does the Baz role");\r
- has_attribute_ok($class_or_obj, $attr_name, "... Foo has the 'bar' attribute");\r
-\r
-=cut\r
-\r
+package Test::Mouse;
+
+use strict;
+use warnings;
+use Carp qw(croak);
+use Mouse::Util qw(find_meta does_role);
+
+use base qw(Test::Builder::Module);
+
+our @EXPORT = qw(meta_ok does_ok has_attribute_ok);
+
+sub meta_ok ($;$) {
+ my ($class_or_obj, $message) = @_;
+
+ $message ||= "The object has a meta";
+
+ if (find_meta($class_or_obj)) {
+ return __PACKAGE__->builder->ok(1, $message)
+ }
+ else {
+ return __PACKAGE__->builder->ok(0, $message);
+ }
+}
+
+sub does_ok ($$;$) {
+ my ($class_or_obj, $does, $message) = @_;
+
+ if(!defined $does){
+ croak "You must pass a role name";
+ }
+ $message ||= "The object does $does";
+
+ if (does_ok($class_or_obj)) {
+ return __PACKAGE__->builder->ok(1, $message)
+ }
+ else {
+ return __PACKAGE__->builder->ok(0, $message);
+ }
+}
+
+sub has_attribute_ok ($$;$) {
+ my ($class_or_obj, $attr_name, $message) = @_;
+
+ $message ||= "The object does has an attribute named $attr_name";
+
+ my $meta = find_meta($class_or_obj);
+
+ if ($meta->find_attribute_by_name($attr_name)) {
+ return __PACKAGE__->builder->ok(1, $message)
+ }
+ else {
+ return __PACKAGE__->builder->ok(0, $message);
+ }
+}
+
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Test::Mouse - Test functions for Mouse specific features
+
+=head1 SYNOPSIS
+
+ use Test::More plan => 1;
+ use Test::Mouse;
+
+ meta_ok($class_or_obj, "... Foo has a ->meta");
+ does_ok($class_or_obj, $role, "... Foo does the Baz role");
+ has_attribute_ok($class_or_obj, $attr_name, "... Foo has the 'bar' attribute");
+
+=cut
+