add Existing* types
[gitmo/MooseX-Types-Path-Class.git] / t / 04.existing.t
diff --git a/t/04.existing.t b/t/04.existing.t
new file mode 100644 (file)
index 0000000..8292d9c
--- /dev/null
@@ -0,0 +1,14 @@
+use strict;
+use warnings;
+use Test::More;
+
+plan skip_all => "Preconditions failed; your filesystem is strange"
+  unless -d "/etc" && -e "/etc/passwd";
+
+use MooseX::Types::Path::Class qw(ExistingFile ExistingDir);
+
+ok is_ExistingFile(to_ExistingFile("/etc/passwd")), '/etc/passwd is an existing file';
+
+ok is_ExistingDir(to_ExistingDir("/etc/")), '/etc/ is an existing directory';
+
+done_testing;