}
- method project_dir (Path::Class::Dir $project) {
- my $dir = $project->stringify;
+ method project_dir {
+ my $dir = $self->path->stringify;
$dir .= '/.git'
if -f dir($dir)->file('.git/HEAD');
return $dir;
# Compatibility
-=head2 project_info
+=head2 info
Returns a hash containing properties of this project. The keys will
be:
=cut
- method project_info {
+ method info {
return {
name => $self->name,
description => $self->description,
name => "repo1",
);
isa_ok($proj, 'Gitalist::Git::Project');
-
is($proj->path, $gitdir, 'repository path is set');
is($proj->name, qw/repo1/, 'repository name is set');
is($proj->description, qq/some test repository/, 'repository description loaded');
isa_ok($proj->last_change, 'DateTime', 'last_change');
+is($proj->info->{name}, qw/repo1/, 'repo name in info hash');
+
is($proj->head_hash, qw/36c6c6708b8360d7023e8a1649c45bcf9b3bd818/, 'head_hash for HEAD is correct');
is(scalar $proj->list_tree, 2, 'expected number of entries in tree');