summaryrefslogtreecommitdiffstats
path: root/t/001-basic.t
diff options
context:
space:
mode:
Diffstat (limited to 't/001-basic.t')
-rw-r--r--t/001-basic.t24
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;