cleanups.
Zachary Stevens [Sun, 1 Nov 2009 16:05:57 +0000 (16:05 +0000)]
lib/Gitalist/Git/Project.pm
t/git/project.t

index 5209149..ceea61b 100644 (file)
@@ -112,8 +112,8 @@ The keys for each item will be:
     }
 
 
-    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;
@@ -121,7 +121,7 @@ The keys for each item will be:
 
     # Compatibility
 
-=head2 project_info
+=head2 info
 
 Returns a hash containing properties of this project. The keys will
 be:
@@ -133,7 +133,7 @@ be:
 
 =cut
 
-    method project_info {
+    method info {
         return {
             name => $self->name,
             description => $self->description,
index 21f7731..6a8da94 100644 (file)
@@ -15,12 +15,13 @@ my $proj = Gitalist::Git::Project->new(
     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');