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