4 use Test::More 'no_plan';
10 # =begin testing SETUP
13 package MyApp::Meta::Attribute::Trait::Labeled;
19 predicate => 'has_label',
22 package Mouse::Meta::Attribute::Custom::Trait::Labeled;
23 sub register_implementation {'MyApp::Meta::Attribute::Trait::Labeled'}
25 package MyApp::Website;
29 traits => [qw/Labeled/],
32 label => "The site's URL",
45 my %attributes = %{ $self->meta->get_attribute_map };
46 for my $name ( sort keys %attributes ) {
47 my $attribute = $attributes{$name};
49 if ( $attribute->does('MyApp::Meta::Attribute::Trait::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" );
74 = MyApp::Website->new( url => "http://google.com", name => "Google" );
76 $app2->dump, q{name: Google
77 The site's URL: http://google.com
78 }, '... got the expected dump value'