Resolve a todo
[gitmo/Mouse.git] / t / 020_attributes / 026_attribute_without_any_methods.t
CommitLineData
4060c871 1#!/usr/bin/perl
db53d2b4 2BEGIN{ $ENV{MOUSE_VERBOSE} = 1 }
4060c871 3use strict;
4use warnings;
5
6use Test::More tests => 2;
7
8use Mouse ();
9use Mouse::Meta::Class;
10
11my $meta = Mouse::Meta::Class->create('Banana');
12
13my $warn;
14$SIG{__WARN__} = sub { $warn = "@_" };
15
16$meta->add_attribute('foo');
17like $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');
22is $warn, '', 'add attribute with no methods and is => "bare"';