7 'Test::Output' => '0.01', # skip all if not installed
23 my $foo_meta = Foo->meta;
25 sub { $foo_meta->add_attribute( a => ( reader => 'get_a' ) ) },
26 qr/^You are overwriting a locally defined method \(get_a\) with an accessor/,
27 'reader overriding gives proper warning'
30 sub { $foo_meta->add_attribute( b => ( writer => 'set_b' ) ) },
31 qr/^You are overwriting a locally defined method \(set_b\) with an accessor/,
32 'writer overriding gives proper warning'
35 sub { $foo_meta->add_attribute( c => ( predicate => 'has_c' ) ) },
36 qr/^You are overwriting a locally defined method \(has_c\) with an accessor/,
37 'predicate overriding gives proper warning'
40 sub { $foo_meta->add_attribute( d => ( clearer => 'clear_d' ) ) },
41 qr/^You are overwriting a locally defined method \(clear_d\) with an accessor/,
42 'clearer overriding gives proper warning'
45 sub { $foo_meta->add_attribute( e => ( is => 'rw' ) ) },
46 qr/^You are overwriting a locally defined method \(e\) with an accessor/,
47 'accessor overriding gives proper warning'
50 sub { $foo_meta->add_attribute( stub => ( is => 'rw' ) ) },
52 'overriding a stub with an accessor does not warn'
55 sub { $foo_meta->add_attribute( has => ( is => 'rw' ) ) },
56 qr/^You are overwriting a locally defined function \(has\) with an accessor/,
57 'function overriding gives proper warning'