We don't use English in Moose, or in these test files
[gitmo/Moose.git] / t / 010_basics / 021_attr_override_method_warning.t
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4
5 use Test::More tests => 2;
6
7 my @warnings;
8 local $SIG{__WARN__} = sub { push @warnings,@_ };
9     eval <<EOP;
10 package MyThingy;
11 use Moose;
12
13 has foo => ( is => 'rw' );
14 sub foo { 'omglolbbq' }
15
16 package main;
17 EOP
18
19 is( scalar(@warnings), 1, 'got 1 warning' );
20 like( $warnings[0], qr/\bfoo\b.+redefine/, 'got a redefinition warning that mentions redefining or overriding or something');
21