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