Test::SVN::Repo - Subversion repository fixtures for testing
version 0.009
# Create a plain on-disk repo $repo = Test::SVN::Repo->new; # Create a repo with password authenticated server $repo = Test::SVN::Repo->new( users => { joe => 'secret', fred => 'foobar' }, ); my $repo_url = $repo->url; system("svn co $repo"); # do stuff with your new repo
Create temporary subversion repositories for testing.
If no authentication is required, a simple on-disk repo is created. An svnserve instance is created when authentication is required.
Repositories and servers are cleaned up when the object is destroyed.
Requires the svnadmin and svnserve external binaries. These are both included in standard Subversion releases.
svnadmin
svnserve
Creates a new svn repository, spawning an svnserve server if authentication is required.
Arguments. All are optional.
Hashref containing username/password pairs for repository authentication.
If this attribute is specified, there must be at least one user. Specifying users causes an svnserve instance to be created.
Base path to create the repo. By default, a temporary directory is created, and deleted on exit.
Prevent root_path from being deleted in the destructor.
If root_path is provided in the constructor, it will be preserved by default. If no root_path is provided, and a temporary directory is created, it will be destroyed by default.
Verbose output. Default off.
Server mode only.
In order to find a free port for the server, ports are randomly selected from the range [start_port, end_port] until one succeeds. Gives up after retry_count failures.
Default values: 1024, 65536, 1000
Repository URL.
Local path to the SVN repository.
True if the the svn repo requires authorisation. This is enabled by supplying a users hashref to the constructor.
Process id of the svnserve process.
Listen port of the svnserve process.
Thanks to Strategic Data for sponsoring the development of this module.
Stephen Thirlwall <sdt@cpan.org>
This software is copyright (c) 2013 by Stephen Thirlwall.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Test::SVN::Repo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::SVN::Repo
CPAN shell
perl -MCPAN -e shell install Test::SVN::Repo
For more information on module installation, please visit the detailed CPAN module installation guide.