36a6a1917389768476823d13e08081f203a3f5ec
[gitmo/Mouse.git] / t / 020_attributes / 026_attribute_without_any_methods.t
1 #!/usr/bin/perl
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
6 use strict;
7 use warnings;
8
9 use Test::More;
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"';
26
27 done_testing;