summaryrefslogtreecommitdiffstats
path: root/t/lib/FileAttributes.pm
diff options
context:
space:
mode:
Diffstat (limited to 't/lib/FileAttributes.pm')
-rw-r--r--t/lib/FileAttributes.pm29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/lib/FileAttributes.pm b/t/lib/FileAttributes.pm
new file mode 100644
index 0000000..04e6f2e
--- /dev/null
+++ b/t/lib/FileAttributes.pm
@@ -0,0 +1,29 @@
+package FileAttributes;
+use MooseX::Exporter::Easy;
+use MooseX::Types::Path::Class qw(File Dir);
+
+with_meta has_file => sub {
+ my ($meta, $name, %options) = @_;
+ $meta->add_attribute(
+ $name,
+ is => 'ro',
+ isa => File,
+ coerce => 1,
+ %options,
+ );
+};
+
+with_meta has_dir => sub {
+ my ($meta, $name, %options) = @_;
+ $meta->add_attribute(
+ $name,
+ is => 'ro',
+ isa => Dir,
+ coerce => 1,
+ %options,
+ );
+};
+
+export;
+
+1;