We only need local $? if we inline calls to DEMOLISH
[gitmo/Moose.git] / t / attributes / attribute_without_any_methods.t
CommitLineData
86cf196b 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
a28e50e4 6use Test::More;
86cf196b 7
8use Moose ();
9use Moose::Meta::Class;
10
8f4450f3 11my $meta = Moose::Meta::Class->create('Banana');
86cf196b 12
13my $warn;
14$SIG{__WARN__} = sub { $warn = "@_" };
15
16$meta->add_attribute('foo');
8f4450f3 17like $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');
22is $warn, '', 'add attribute with no methods and is => "bare"';
a28e50e4 23
24done_testing;