Merge branch 'master' of git.shadowcat.co.uk:Oyster
[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' ); }
680e49c2 12BEGIN { use_ok( 'Git::Wrapper' ); }
40056462 13
14my $tmpdir = tempdir();
15
16my $deploy = new_ok 'Oyster::Deploy::Git';
17
18#create
19is($deploy->create("${tmpdir}/testapp"), 1, 'Create returned okay');
20
21ok((-d "${tmpdir}/testapp"), "App directory created");
22
23throws_ok(sub {$deploy->create("${tmpdir}/testapp")}, 'Error::Simple', "Directory already exists");
6b832bd6 24ok((-f "${tmpdir}/testapp/.git/hooks/post-receive"), "Post receive hook exists");
25ok((-f "${tmpdir}/testapp/.git/hooks/post-update"), "Post update hook exists");