4 use Test::More qw/no_plan/;
6 BEGIN { use_ok 'Gitalist::Model::Git' }
8 my $c = bless {}, 'Gitalist';
9 my $Git = Gitalist::Model::Git->new($c, { repo_dir => "$Bin/lib/repositories" });
11 # 'bare.git' is a bare git repository in the repository dir
13 my $repoBare = Path::Class::Dir->new('t/lib/repositories/bare.git');
14 ok( $Git->is_git_repo( $repoBare ), 'is_git_repo true for bare git repo' );
16 # 'working' is a working copy w/ git repo in the repository dir
17 my $repoWorking = Path::Class::Dir->new('t/lib/repositories/working');
18 #ok( $Git->is_git_repo( $repoWorking ), 'is_git_repo true for git repo in working copy' );
20 # 'empty.git' is an empty directory in the repository dir
21 my $repoEmpty = Path::Class::Dir->new('t/lib/repositories/empty.git');
22 ok( ! $Git->is_git_repo( $repoEmpty ), 'is_git_repo is false for empty dir' );
24 my $projectList = $Git->list_projects;
25 ok( scalar @{$projectList} == 1, 'list_projects returns an array with the correct number of members' );
26 ok( $projectList->[0]->{name} eq 'bare.git', 'list_projects has correct name for "bare.git" repo' );
27 #ok( $projectList->[1]->{name} eq 'working/.git', 'list_projects has correct name for "working" repo' );
30 #warn( Dumper($projectList) );