summaryrefslogtreecommitdiffstats
path: root/t/extending/file.t
diff options
context:
space:
mode:
Diffstat (limited to 't/extending/file.t')
-rwxr-xr-xt/extending/file.t22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/extending/file.t b/t/extending/file.t
new file mode 100755
index 0000000..c6868cd
--- /dev/null
+++ b/t/extending/file.t
@@ -0,0 +1,22 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+use Test::Exception;
+use lib 't/lib';
+
+{
+ package Foo;
+ use Moose;
+ use FileAttributes;
+
+ has_file 'foo';
+ has_dir 'bar' => (required => 1);
+}
+
+my $foo = Foo->new(bar => '.');
+isa_ok($foo->bar, 'Path::Class::Dir');
+
+throws_ok { Foo->new(foo => 'test.pl') } qr/required/, "bar is required";
+
+done_testing;