Fix a typo
[gitmo/Mouse.git] / Moose-t-failing / 020_attributes / 023_attribute_names.t
CommitLineData
4060c871 1#!/usr/bin/perl
c47cf415 2# This is automatically generated by author/import-moose-test.pl.
3# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4use t::lib::MooseCompat;
4060c871 5
6use strict;
7use warnings;
c47cf415 8use Test::More;
9$TODO = q{Mouse is not yet completed};
4060c871 10use Test::Exception;
11
12my $exception_regex = qr/You must provide a name for the attribute/;
13{
14 package My::Role;
15 use Mouse::Role;
16
17 ::throws_ok {
18 has;
19 } $exception_regex, 'has; fails';
20
21 ::throws_ok {
22 has undef;
23 } $exception_regex, 'has undef; fails';
24
25 ::lives_ok {
26 has "" => (
27 is => 'bare',
28 );
29 } 'has ""; works now';
30
31 ::lives_ok {
32 has 0 => (
33 is => 'bare',
34 );
35 } 'has 0; works now';
36}
37
38{
39 package My::Class;
40 use Mouse;
41
42 ::throws_ok {
43 has;
44 } $exception_regex, 'has; fails';
45
46 ::throws_ok {
47 has undef;
48 } $exception_regex, 'has undef; fails';
49
50 ::lives_ok {
51 has "" => (
52 is => 'bare',
53 );
54 } 'has ""; works now';
55
56 ::lives_ok {
57 has 0 => (
58 is => 'bare',
59 );
60 } 'has 0; works now';
61}
62
c47cf415 63done_testing;