diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-05-07 13:37:46 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-05-07 13:37:46 -0500 |
commit | 07df3a29274a3ea803f2667403b3838647a251df (patch) | |
tree | 21fed482c5c28e463d2b607ad5d38b06aa1c0d44 | |
parent | 2a261203f2a169314f88227f898e1411eee2c258 (diff) | |
download | moosex-attribute-shorthand-07df3a29274a3ea803f2667403b3838647a251df.tar.gz moosex-attribute-shorthand-07df3a29274a3ea803f2667403b3838647a251df.zip |
add test for mop stuff
-rw-r--r-- | t/003-mop.t | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/003-mop.t b/t/003-mop.t new file mode 100644 index 0000000..53b0b2e --- /dev/null +++ b/t/003-mop.t @@ -0,0 +1,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; |