4 use Test::More 'no_plan';
10 # =begin testing SETUP
13 package MyApp::Meta::Attribute::Labeled;
15 extends 'Mouse::Meta::Attribute';
20 predicate => 'has_label',
23 package Mouse::Meta::Attribute::Custom::Labeled;
24 sub register_implementation {'MyApp::Meta::Attribute::Labeled'}
26 package MyApp::Website;
30 metaclass => 'Labeled',
33 label => "The site's URL",
46 for my $name ( sort $self->meta->get_attribute_list ) {
47 my $attribute = $self->meta->get_attribute($name);
49 if ( $attribute->isa('MyApp::Meta::Attribute::Labeled')
50 && $attribute->has_label ) {
51 $dump .= $attribute->label;
57 my $reader = $attribute->get_read_method;
58 $dump .= ": " . $self->$reader . "\n";
66 my $app = MyApp::Website->new( url => "http://google.com", name => "Google" );
73 my $app = MyApp::Website->new( url => "http://google.com", name => "Google" );
75 $app->dump, q{name: Google
76 The site's URL: http://google.com
77 }, '... got the expected dump value'