From: Tomas Doran Date: Sun, 27 Dec 2009 18:06:32 +0000 (+0000) Subject: Check that everything appears to work for both types of repository specification X-Git-Tag: 0.000005~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=20f9a2d42803dcd3b1e47840b803a3642d1342a1;p=catagits%2FGitalist.git Check that everything appears to work for both types of repository specification --- diff --git a/t/model_gitrepos.t b/t/model_gitrepos.t index 3b7cb34..ee78cb6 100644 --- a/t/model_gitrepos.t +++ b/t/model_gitrepos.t @@ -3,9 +3,11 @@ use warnings; use Test::More; use Test::Exception; +use FindBin; use Moose (); use Moose::Object; +use Moose::Autobox; use Class::MOP::Class; use Catalyst::Request; use Catalyst::Response; @@ -83,6 +85,20 @@ throws_ok { Gitalist::Model::GitRepos->COMPONENT($ctx_gen->(), { repos => [ temp lives_ok { Gitalist::Model::GitRepos->COMPONENT($ctx_gen->(), {}) } 'GITALIST_REPO_DIR env variable works'; } +{ + my $i = test_with_config({ repo_dir => "$FindBin::Bin/lib/repositories"}); + is scalar($i->repositories->flatten), 3, 'Found 3 repos'; +} + +{ + my $i = test_with_config({ repos => [ + "$FindBin::Bin/lib/repositories/bare.git", + "$FindBin::Bin/lib/repositories/repo1", + "$FindBin::Bin/lib/repositories/nodescription", + ]}); + is scalar($i->repositories->flatten), 3, 'Found 3 repos'; +} + sub test_with_config { my ($config, $msg) = @_; my $ctx = $ctx_gen->();