We only need local $? if we inline calls to DEMOLISH
[gitmo/Moose.git] / t / attributes / accessor_overwrite_warning.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5
6 use Test::Requires {
7     'Test::Output' => '0.01',
8 };
9
10 {
11     package Bar;
12     use Moose;
13
14     has has_attr => (
15         is => 'ro',
16     );
17
18     ::stderr_like{ has attr => (
19             is        => 'ro',
20             predicate => 'has_attr',
21         )
22         }
23         qr/\QYou are overwriting an accessor (has_attr) for the has_attr attribute with a new accessor method for the attr attribute/,
24         'overwriting an accessor for another attribute causes a warning';
25 }
26
27 done_testing;