Added post commit hooks
[p5sagit/Oyster.git] / t / Deploy / git.t
CommitLineData
40056462 1#!/usr/local/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More qw/no_plan/;
7use Test::Exception;
8
9use File::Temp qw/tempdir/;
10
11BEGIN { use_ok( 'Oyster::Deploy::Git' ); }
12
13my $tmpdir = tempdir();
14
15my $deploy = new_ok 'Oyster::Deploy::Git';
16
17#create
18is($deploy->create("${tmpdir}/testapp"), 1, 'Create returned okay');
19
20ok((-d "${tmpdir}/testapp"), "App directory created");
21
22throws_ok(sub {$deploy->create("${tmpdir}/testapp")}, 'Error::Simple', "Directory already exists");
47863b26 23ok((-f "${tmpdir}/testapp/.git/hooks/post-receive"), "Post reveive hook exists");
24ok((-f "${tmpdir}/testapp/.git/hooks/post-update"), "Post update hook exists");