Commit | Line | Data |
86cf196b |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
a28e50e4 |
6 | use Test::More; |
86cf196b |
7 | |
8 | use Moose (); |
9 | use Moose::Meta::Class; |
10 | |
8f4450f3 |
11 | my $meta = Moose::Meta::Class->create('Banana'); |
86cf196b |
12 | |
13 | my $warn; |
14 | $SIG{__WARN__} = sub { $warn = "@_" }; |
15 | |
16 | $meta->add_attribute('foo'); |
8f4450f3 |
17 | like $warn, qr/Attribute \(foo\) of class Banana has no associated methods/, |
86cf196b |
18 | 'correct error message'; |
19 | |
20 | $warn = ''; |
21 | $meta->add_attribute('bar', is => 'bare'); |
22 | is $warn, '', 'add attribute with no methods and is => "bare"'; |
a28e50e4 |
23 | |
24 | done_testing; |