Possibly fixed test
[p5sagit/Oyster.git] / .build / 0ey2IQdAX1 / t / Deploy / git.t
diff --git a/.build/0ey2IQdAX1/t/Deploy/git.t b/.build/0ey2IQdAX1/t/Deploy/git.t
new file mode 100644 (file)
index 0000000..205665c
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/local/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More qw/no_plan/;
+use Test::Exception;
+
+use File::Temp qw/tempdir/;
+
+BEGIN { use_ok( 'Oyster::Deploy::Git' ); }
+
+my $tmpdir = tempdir();
+
+my $deploy = new_ok 'Oyster::Deploy::Git';
+
+#create
+is($deploy->create("${tmpdir}/testapp"), 1, 'Create returned okay');
+
+ok((-d "${tmpdir}/testapp"), "App directory created");
+
+throws_ok(sub {$deploy->create("${tmpdir}/testapp")}, 'Error::Simple', "Directory already exists");
+ok((-f "${tmpdir}/testapp/.git/hooks/post-receive"), "Post reveive hook exists");
+ok((-f "${tmpdir}/testapp/.git/hooks/post-update"), "Post update hook exists");
\ No newline at end of file