From: Fuji, Goro Date: Thu, 28 Oct 2010 12:50:43 +0000 (+0900) Subject: Add tests X-Git-Tag: 0.81~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0d8640df33c576d6d331c5ae0106a11805372552;p=gitmo%2FMouse.git Add tests --- diff --git a/t/001_mouse/070-inherit-role-attr.t b/t/001_mouse/070-inherit-role-attr.t new file mode 100644 index 0000000..ba46a3f --- /dev/null +++ b/t/001_mouse/070-inherit-role-attr.t @@ -0,0 +1,31 @@ +#!perl -w +use strict; +use Test::More; +{ + package Role; + use Mouse::Role; + + has foo => ( + is => 'bare', + init_arg => undef, + ); + + package Class; + use Mouse; + with 'Role'; + + has "+foo" => ( + default => 'bar', + ); + + ::ok( __PACKAGE__->meta->find_attribute_by_name('foo')->has_default ); +} + +my $foo = Class->meta->get_attribute('foo'); +ok $foo; +is $foo->name, 'foo'; +is $foo->init_arg, undef; +is $foo->default, 'bar'; + +done_testing; +