X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F020_attributes%2F012_misc_attribute_tests.t;h=24e3f70f12ddde8a42999ac7dfad5dbbb720d52d;hb=03e7dbecf3e631d5fb5884b16e3eafe4c14624c3;hp=d25d1c81ec46a1b022ce47f19494341314dda1fb;hpb=238b424d76e067fae0190cf70dd93a75565436bf;p=gitmo%2FMoose.git diff --git a/t/020_attributes/012_misc_attribute_tests.t b/t/020_attributes/012_misc_attribute_tests.t index d25d1c8..24e3f70 100644 --- a/t/020_attributes/012_misc_attribute_tests.t +++ b/t/020_attributes/012_misc_attribute_tests.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 42; +use Test::More tests => 44; use Test::Exception; BEGIN { @@ -87,6 +87,28 @@ BEGIN { { { + package Test::Arrayref::RoleAttributes::Role; + use Moose::Role; + + has [qw(foo bar baz)] => ( + is => 'rw', + ); + + } + { + package Test::Arrayref::RoleAttributes; + use Moose; + with 'Test::Arrayref::RoleAttributes::Role'; + } + + my $test = Test::Arrayref::RoleAttributes->new; + isa_ok($test, 'Test::Arrayref::RoleAttributes'); + can_ok($test, qw(foo bar baz)); + +} + +{ + { package Test::UndefDefault::Attributes; use Moose; @@ -120,7 +142,8 @@ BEGIN { throws_ok { $moose_obj->a_str( $moose_obj ) - } qr/Attribute \(a_str\) does not pass the type constraint \(Str\) with OverloadedStr\=HASH\(.*?\)/, '... dies without overloading the string'; + } qr/Attribute \(a_str\) does not pass the type constraint because\: Validation failed for 'Str' failed with value OverloadedStr=HASH\(0x.+?\)/, + '... dies without overloading the string'; } @@ -134,7 +157,8 @@ BEGIN { throws_ok { OverloadBreaker->new; - } qr/Attribute \(a_num\) does not pass the type constraint \(Int\) with \'7\.5\'/, '... this doesnt trip overload to break anymore '; + } qr/Attribute \(a_num\) does not pass the type constraint because\: Validation failed for 'Int' failed with value 7\.5/, + '... this doesnt trip overload to break anymore '; lives_ok { OverloadBreaker->new(a_num => 5);