App::GitHooks::Test - Shared test functions for App::GitHooks.
Version 1.0.8
Create a file and add it to the git index.
ok_add_file( repository => $repository, path => $path, content => $content, );
Arguments:
repository (mandatory)
A Git::Repository object.
Git::Repository
path (mandatory)
The path of the file to write, relative to the root of the git repository passed.
content (optional)
The content of the file to write.
Create files and add them to the git index.
ok_add_files( repository => $repository, files => { $file_name => $file_content, ... }, );
files (optional)
A hashref with file names as keys and the content of each file as the corresponding value.
Set up a test repository.
ok_setup_repository( cleanup_test_repository => $cleanup_test_repository, # default 1 config => $config, # default '' hooks => \@hooks, # default [] plugins => \@plugins, # default [] );
cleanup_test_repository
Whether the test repository created in order to run a test should be destroyed at the end of the test (default: 1).
config
Elements to add to the .githooksrc file set up at the root of the test repository.
.githooksrc
hooks
An arrayref of the names of the hooks to set up for this test (for example, commit-msg).
commit-msg
plugins
An arrayref of the module names of the plugins to run for this test (for example, App::GitHooks::Plugins::Test::CustomReply).
App::GitHooks::Plugins::Test::CustomReply
Test a git hook.
App::GitHooks::Test::test_hook( tests => \@tests, hook_name => $hook_name, plugins => \@plugins, cleanup_test_repository => $cleanup_test_repository, # default 1 );
Mandatory arguments:
tests
A set of tests to run.
# TODO: document tests format.
hook_name
The name of the git hook to test (for example, commit-msg).
Optional arguments:
Please report any bugs or feature requests through the web interface at https://github.com/guillaumeaubert/App-GitHooks/issues/new. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc App::GitHooks::Test
You can also look for information at:
GitHub's request tracker
https://github.com/guillaumeaubert/App-GitHooks/issues
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/app-githooks
CPAN Ratings
http://cpanratings.perl.org/d/app-githooks
MetaCPAN
https://metacpan.org/release/App-GitHooks
Guillaume Aubert, <aubertg at cpan.org>.
<aubertg at cpan.org>
Copyright 2013-2014 Guillaume Aubert.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/
To install App::GitHooks, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::GitHooks
CPAN shell
perl -MCPAN -e shell install App::GitHooks
For more information on module installation, please visit the detailed CPAN module installation guide.