Commit | Line | Data |
d111406d |
1 | #!/usr/bin/perl |
2 | use strict; |
3 | use warnings; |
d111406d |
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 | |
fe587668 |
19 | TODO: { |
20 | local $TODO = "Class-MOP does not warn about this yet"; |
21 | is( scalar(@warnings), 1, 'got 1 warning' ); |
22 | like( $warnings[0], qr/\bfoo\b.+redefine/, 'got a redefinition warning that mentions redefining or overriding or something'); |
23 | } |