5 use Test::More tests => 8;
8 # note: not sure about "" and 0 being illegal attribute names
9 # but I'm just copying what Class::MOP::Attribute does
11 my $exception_regex = qr/You must provide a name for the attribute/;
15 ::throws_ok{ has; } $exception_regex, 'has; fails';
16 ::throws_ok{ has undef; } $exception_regex, 'has undef; fails';
17 ::throws_ok{ has ""; } $exception_regex, 'has ""; fails';
18 ::throws_ok{ has 0; } $exception_regex, 'has 0; fails';
24 ::throws_ok{ has; } $exception_regex, 'has; fails';
25 ::throws_ok{ has undef; } $exception_regex, 'has undef; fails';
26 ::throws_ok{ has ""; } $exception_regex, 'has ""; fails';
27 ::throws_ok{ has 0; } $exception_regex, 'has 0; fails';