From: Tomas Doran Date: Sun, 10 Jan 2010 23:35:56 +0000 (+0000) Subject: Add a trivial test X-Git-Tag: 0.002001_01~38 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FGitalist.git;a=commitdiff_plain;h=ce2bd1e07847124f2e768c9391163c4e02cf3969 Add a trivial test --- diff --git a/lib/Gitalist/Git/Repository.pm b/lib/Gitalist/Git/Repository.pm index 57158f1..5818fb5 100644 --- a/lib/Gitalist/Git/Repository.pm +++ b/lib/Gitalist/Git/Repository.pm @@ -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', diff --git a/t/02git_Repository.t b/t/02git_Repository.t index 7a24a3c..175e52f 100644 --- a/t/02git_Repository.t +++ b/t/02git_Repository.t @@ -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');