Commit | Line | Data |
4060c871 |
1 | #!/usr/bin/perl |
db53d2b4 |
2 | BEGIN{ $ENV{MOUSE_VERBOSE} = 1 } |
4060c871 |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::More tests => 2; |
7 | |
8 | use Mouse (); |
9 | use Mouse::Meta::Class; |
10 | |
11 | my $meta = Mouse::Meta::Class->create('Banana'); |
12 | |
13 | my $warn; |
14 | $SIG{__WARN__} = sub { $warn = "@_" }; |
15 | |
16 | $meta->add_attribute('foo'); |
17 | like $warn, qr/Attribute \(foo\) of class Banana has no associated methods/, |
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"'; |