summaryrefslogtreecommitdiffstats
path: root/t/001-basic.t
blob: f3445a4019e16c5fbeb540835dc08cbd4cf88a4b (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
24
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Test::Exception;

{
    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 $foo = Foo->new;
is($foo->foo, 'FOO', "expanded properly");
dies_ok { $foo->foo('sldkfj') } "expanded properly";

done_testing;