From e0b21df6d7872b520dd4694c07608f99813ba9bd Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 7 May 2010 04:55:31 -0500 Subject: initial implementation --- t/001-basic.t | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 t/001-basic.t (limited to 't') 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; -- cgit v1.2.3-54-g00ecf