Do the correct thing with type contraints etc to be able to serialize things
[catagits/Gitalist.git] / t / 02git_Repository.t
index e8ee762..8f123f5 100644 (file)
@@ -37,6 +37,20 @@ 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');