X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F020_attributes%2Ffailing%2F026_attribute_without_any_methods.t;fp=t%2F020_attributes%2Ffailing%2F026_attribute_without_any_methods.t;h=ece05db22304c2b2e75c99b89dd0e56d451397c9;hb=4060c871da12ba3c5e88986ed121a8254f906bd6;hp=0000000000000000000000000000000000000000;hpb=95ecd6f132112c6763cdaf2e6bc72c39e9ab76b5;p=gitmo%2FMouse.git diff --git a/t/020_attributes/failing/026_attribute_without_any_methods.t b/t/020_attributes/failing/026_attribute_without_any_methods.t new file mode 100644 index 0000000..ece05db --- /dev/null +++ b/t/020_attributes/failing/026_attribute_without_any_methods.t @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Test::More tests => 2; + +use Mouse (); +use Mouse::Meta::Class; + +my $meta = Mouse::Meta::Class->create('Banana'); + +my $warn; +$SIG{__WARN__} = sub { $warn = "@_" }; + +$meta->add_attribute('foo'); +like $warn, qr/Attribute \(foo\) of class Banana has no associated methods/, + 'correct error message'; + +$warn = ''; +$meta->add_attribute('bar', is => 'bare'); +is $warn, '', 'add attribute with no methods and is => "bare"';