Big cleanup of ::Repo.
[catagits/Gitalist.git] / t / 02git_repo.t
index 8d98e95..4f5758b 100644 (file)
@@ -2,6 +2,7 @@ use strict;
 use warnings;
 use FindBin qw/$Bin/;
 use Test::More qw/no_plan/;
+use Test::Exception;
 
 use Data::Dumper;
 
@@ -13,8 +14,16 @@ isa_ok($repo, 'Gitalist::Git::Repo');
 
 is($repo->repo_dir, $repo_dir, "repo->repo_dir is correct" );
 
-my $project_list = $repo->list_projects;
+my $project_list = $repo->{projects};
 isa_ok(@$project_list[0], 'Gitalist::Git::Project');
 
+dies_ok {
+    my $project = $repo->project('NoSuchProject');
+} 'throws exception for invalid project';
+
+dies_ok {
+    my $project = $repo->project();
+} 'throws exception for no project';
+
 my $project = $repo->project('repo1');
 isa_ok($project, 'Gitalist::Git::Project');