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 for my $name ( sort $self->meta->get_attribute_list ) {
46 my $attribute = $self->meta->get_attribute($name);
48 if ( $attribute->does('MyApp::Meta::Attribute::Trait::Labeled')
49 && $attribute->has_label ) {
50 $dump .= $attribute->label;
56 my $reader = $attribute->get_read_method;
57 $dump .= ": " . $self->$reader . "\n";
65 my $app = MyApp::Website->new( url => "http://google.com", name => "Google" );
73 = MyApp::Website->new( url => "http://google.com", name => "Google" );
75 $app2->dump, q{name: Google
76 The site's URL: http://google.com
77 }, '... got the expected dump value'