https://github.com/book/git-repository-plugin-test
Helper methods for testing interactions with Git
https://github.com/book/git-repository-plugin-test
Last synced: over 1 year ago
JSON representation
Helper methods for testing interactions with Git
- Host: GitHub
- URL: https://github.com/book/git-repository-plugin-test
- Owner: book
- Created: 2014-01-06T08:30:32.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2019-09-29T06:42:34.000Z (almost 7 years ago)
- Last Synced: 2025-02-05T01:45:21.670Z (over 1 year ago)
- Language: Perl
- Homepage:
- Size: 164 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
# NAME
Git::Repository::Plugin::Test - Helper methods for testing interactions with Git
# VERSION
version 0.007
# SYNOPSIS
use Test::More tests => 2;
use Git::Repository qw(Test);
my $repo = Git::Repository->new(...);
# run Git commands as tests
$repo->run_exit_ok('status');
$repo->run_exit_is(1, 'nonexistant-subcommand');
# DESCRIPTION
Adds `run_exit_ok` and `run_exit_is` methods to the Git::Repository object
that can be used for testing Git operations.
# METHODS
[Git::Repository::Plugin::Test](https://metacpan.org/pod/Git::Repository::Plugin::Test) adds the
following methods:
## run\_exit\_ok(@cmd)
Like [Git::Repository](https://metacpan.org/pod/Git::Repository)'s `run` but exceptions are caught and
reported as test failures.
## run\_exit\_is($expected\_exit\_code, @cmd)
Like [Git::Repository](https://metacpan.org/pod/Git::Repository)'s `run` but exceptions are caught and
reported as test failures unless exit code matches expected exit code.
## branch\_exists($branchname)
=head2 branch\_not\_exists($branchname)
Test for the existance of a branch.
# SEE ALSO
[Git::Repository](https://metacpan.org/pod/Git::Repository), [Test::Builder](https://metacpan.org/pod/Test::Builder), [Git::Repository::Plugin::TestSetUp](https://metacpan.org/pod/Git::Repository::Plugin::TestSetUp)
# AUTHOR
Nathaniel G. Nutter
# COPYRIGHT
Copyright 2013 - Nathaniel G. Nutter
# LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.