Introducing Test::Requires::Git

Git is a wonderful tool, and there are a lot of git wrappers written in Perl on CPAN. They all depend on running git in their test suite.

Test::Requires::Git offers a simple way to declare which versions of git a test depends on, so that it can be skipped if the available git does not match the specification.

This module does not depend on any git wrapper (it would be weird to test one using another), but instead simply runs `git --version` (that command works back to git version 1.0.0 at least) to pick whatever git happens to be in the PATH.

It's more sophisticated than my own Test::Git has_git function, as it supports all version comparison operators (that code comes from Git::Repository, and can also skip a specific number of tests (for use in a SKIP block). It will also do the right thing if your test suite has already started to output some test results.

I recommend using at least version 1.002, as it's the first one that supports all the necessary test features. (I've removed all the previous releases from CPAN anyway.)

My plan for Test::Requires::Git include adding support for Git::Features, when I've actually written it. ;-)

Leave a comment

About BooK

user-pic Pink.