7 eval "use Test::Output;";
8 plan skip_all => "Test::Output is required for this test" if $@;
22 my $foo_meta = Foo->meta;
23 stderr_like(sub { $foo_meta->add_attribute(a => (reader => 'get_a')) },
24 qr/^You are overwriting a locally defined method \(get_a\) with an accessor/, 'reader overriding gives proper warning');
25 stderr_like(sub { $foo_meta->add_attribute(b => (writer => 'set_b')) },
26 qr/^You are overwriting a locally defined method \(set_b\) with an accessor/, 'writer overriding gives proper warning');
27 stderr_like(sub { $foo_meta->add_attribute(c => (predicate => 'has_c')) },
28 qr/^You are overwriting a locally defined method \(has_c\) with an accessor/, 'predicate overriding gives proper warning');
29 stderr_like(sub { $foo_meta->add_attribute(d => (clearer => 'clear_d')) },
30 qr/^You are overwriting a locally defined method \(clear_d\) with an accessor/, 'clearer overriding gives proper warning');
31 stderr_like(sub { $foo_meta->add_attribute(e => (is => 'rw')) },
32 qr/^You are overwriting a locally defined method \(e\) with an accessor/, 'accessor overriding gives proper warning');