Don't warn when overriding a stub method with an accessor
[gitmo/Moose.git] / t / attributes / accessor_override_method.t
index 5c12716..b449591 100644 (file)
@@ -17,6 +17,7 @@ use Test::Requires {
     sub has_c   { }
     sub clear_d { }
     sub e       { }
+    sub stub;
 }
 
 my $foo_meta = Foo->meta;
@@ -45,6 +46,11 @@ stderr_like(
     qr/^You are overwriting a locally defined method \(e\) with an accessor/,
     'accessor overriding gives proper warning'
 );
+stderr_is(
+    sub { $foo_meta->add_attribute( stub => ( is => 'rw' ) ) },
+    q{},
+    'overriding a stub with an accessor does not warn'
+);
 stderr_like(
     sub { $foo_meta->add_attribute( has => ( is => 'rw' ) ) },
     qr/^You are overwriting a locally defined function \(has\) with an accessor/,