From: Dave Rolsky Date: Sun, 17 Oct 2010 20:01:31 +0000 (-0500) Subject: Make warning for default_default include info on how to shut it up X-Git-Tag: 1.16~25 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cab2e1d0e01744f4234ce1031b5b92d964d6a84c;p=gitmo%2FMoose.git Make warning for default_default include info on how to shut it up --- diff --git a/lib/Moose/Meta/Attribute/Native/Trait.pm b/lib/Moose/Meta/Attribute/Native/Trait.pm index 1eb2fc7..de59416 100644 --- a/lib/Moose/Meta/Attribute/Native/Trait.pm +++ b/lib/Moose/Meta/Attribute/Native/Trait.pm @@ -44,7 +44,8 @@ before '_process_options' => sub { Moose::Deprecated::deprecated( feature => 'default default for Native Trait', message => - 'Allowing a native trait to automatically supply a default is deprecated' + 'Allowing a native trait to automatically supply a default is deprecated.' + . ' You can avoid this warning by supply a default, builder, or making the attribute required' ); } }; diff --git a/t/010_basics/030_deprecations.t b/t/010_basics/030_deprecations.t index c63121c..d4d4004 100644 --- a/t/010_basics/030_deprecations.t +++ b/t/010_basics/030_deprecations.t @@ -32,7 +32,7 @@ use Test::Requires { isa => 'Str', ); } - qr/\QAllowing a native trait to automatically supply a default is deprecated/, + qr{\QAllowing a native trait to automatically supply a default is deprecated. You can avoid this warning by supply a default, builder, or making the attribute required at t/010_basics/030_deprecations.t line}, 'Not providing a default for native String trait warns'; ::stderr_is{ has bar => (