Commit | Line | Data |
4060c871 |
1 | #!/usr/bin/perl |
1f5ce14a |
2 | # This is automatically generated by author/import-moose-test.pl. |
3 | # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!! |
4 | use t::lib::MooseCompat; |
5 | |
4060c871 |
6 | use strict; |
7 | use warnings; |
8 | |
1f5ce14a |
9 | use Test::More; |
4060c871 |
10 | |
11 | use Mouse (); |
12 | use Mouse::Meta::Class; |
13 | |
14 | my $meta = Mouse::Meta::Class->create('Banana'); |
15 | |
16 | my $warn; |
17 | $SIG{__WARN__} = sub { $warn = "@_" }; |
18 | |
19 | $meta->add_attribute('foo'); |
20 | like $warn, qr/Attribute \(foo\) of class Banana has no associated methods/, |
21 | 'correct error message'; |
22 | |
23 | $warn = ''; |
24 | $meta->add_attribute('bar', is => 'bare'); |
25 | is $warn, '', 'add attribute with no methods and is => "bare"'; |
1f5ce14a |
26 | |
27 | done_testing; |