Commits

shl...@6f433eb9-a002-0410-945b-ee5462c261ee  committed 0bafb2d

Added the exist() function to TreeCreate.

  • Participants
  • Parent commits 915aa19

Comments (0)

Files changed (2)

File t/02tree-create.t

 use strict;
 use warnings;
 
-use Test::More tests => 5;
+use Test::More tests => 7;
 
 BEGIN
 {
     # TEST
     is ($t->get_path("./one/two/three/four/"), File::Spec->catdir(File::Spec->curdir(), "one", "two", "three", "four"));
 }
+
+{
+    my $t = File::Find::Object::TreeCreate->new();
+
+    # TEST
+    ok ($t->exist("./MANIFEST"), "Checking the exist() method");
+
+    # TEST
+    ok (!$t->exist("./BKLASDJASFDJODIJASDOJASODJ.wok"), 
+        "Checking the exist() method");
+
+}

File t/lib/File/Find/Object/TreeCreate.pm

     }
 }
 
+sub exist
+{
+    my $self = shift;
+    return (-e $self->get_path(@_));
+}
+
 1;