use Error::Simple;
use Data::Dumper;
+use File::Copy;
+use File::ShareDir ':ALL';
sub create {
my $self = shift;
mkdir($location);
my $git = Git::Wrapper->new($location);
+
+ copy(dist_file( 'Oyster', './bin/git/post-receive'), ($git->dir . '.git/hooks/'))
+ or Error::Simple->throw('Creating post commit hooks failed.');
+ copy(dist_file( 'Oyster', './bin/git/post-update'), ($git->dir . '.git/hooks/'))
+ or Error::Simple->throw('Creating post commit hooks failed.');
+
+ chmod(0x755, ('./bin/git/hooks/post-receive', './bin/git/hooks/post-update'));
+
return 1;
}
-1;
\ No newline at end of file
+1;
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