Add a trivial test
Tomas Doran [Sun, 10 Jan 2010 23:35:56 +0000 (23:35 +0000)]
lib/Gitalist/Git/Repository.pm
t/02git_Repository.t

index 57158f1..5818fb5 100644 (file)
@@ -35,7 +35,8 @@ class Gitalist::Git::Repository with Gitalist::Git::HasUtils {
                   is => 'ro', required => 1 );
 
     has path => ( isa => Dir,
-                  is => 'ro', required => 1);
+                  is => 'ro', required => 1,
+                  traits => [qw/ DoNotSerialize /] );
 
     has description => ( isa => Str,
                          is => 'ro',
index 7a24a3c..175e52f 100644 (file)
@@ -37,11 +37,15 @@ isa_ok($proj->path, 'Path::Class::Dir', 'repository path');
 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');
-{
-    my $packed = $proj->pack;
-    use Data::Dumper;
-    warn Dumper $packed;
-}
+
+is_deeply $proj->pack, {
+    '__CLASS__' => 'Gitalist::Git::Repository',
+    'is_bare' => 1,
+    'owner' => "T\x{e9}st",
+    'last_change' => '2009-11-12T19:00:34Z',
+    'name' => 'repo1',
+    'description' => 'some test repository'
+};
 
 my %references = %{$proj->references};
 ok(keys %references >= 2, '->references hash has elements');