diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-05-07 04:55:31 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-05-07 04:55:31 -0500 |
commit | e0b21df6d7872b520dd4694c07608f99813ba9bd (patch) | |
tree | 9092a3e98e398bc54c6d67347f99060837fddb7d /t | |
parent | 36d59057bed9ec98b2d89cd475fefe2a4bf3f0ab (diff) | |
download | moosex-attribute-shorthand-e0b21df6d7872b520dd4694c07608f99813ba9bd.tar.gz moosex-attribute-shorthand-e0b21df6d7872b520dd4694c07608f99813ba9bd.zip |
initial implementation
Diffstat (limited to 't')
-rw-r--r-- | t/001-basic.t | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/t/001-basic.t b/t/001-basic.t new file mode 100644 index 0000000..f3445a4 --- /dev/null +++ b/t/001-basic.t @@ -0,0 +1,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; |