blob: 53b0b2ed64a451676f5ecb11499b9896af3db707 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
{
package Foo;
use Moose;
use MooseX::Attribute::Shorthand string => {
is => 'ro',
isa => 'Str',
default => sub { $_[1] },
-meta_attr_options => { isa => 'Str' },
};
has foo => (string => 'FOO');
}
my $attr = Foo->meta->get_attribute('foo');
can_ok($attr, 'string');
is($attr->string, 'FOO', "attribute set properly");
done_testing;
|