1
1
# !perl
2
2
use strict;
3
3
use warnings;
4
- use Test::More tests => 186 ;
4
+ use Test::More tests => 198 ;
5
5
use Git::PurePerl;
6
6
use Path::Class;
7
7
@@ -18,11 +18,13 @@ foreach my $directory qw(test-project test-project-packs test-project-packs2)
18
18
like( $commit -> sha1, qr / ^[a-z0-9]{40}$ / );
19
19
is( $commit -> tree_sha1, ' 37b4fcd62571f07408e830f455268891f95cecf5' );
20
20
like( $commit -> parent_sha1, qr / ^[a-z0-9]{40}$ / );
21
- like( $commit -> author,
22
- qr / ^Your Name Comes Here <you\@ yourdomain.example.com>/ );
23
- like( $commit -> committer,
24
- qr / ^Your Name Comes Here <you\@ yourdomain.example.com>/ );
25
- is( $commit -> comment, ' add again' );
21
+ isa_ok( $commit -> author, ' Git::PurePerl::Actor' );
22
+ isa_ok( $commit -> committer, ' Git::PurePerl::Actor' );
23
+ is( $commit -> author-> name, ' Your Name Comes Here' );
24
+ is( $commit -> committer-> name, ' Your Name Comes Here' );
25
+ isa_ok( $commit -> authored_time, ' DateTime' );
26
+ is( $commit -> authored_time-> month, 11 );
27
+ is( $commit -> comment, ' add again' );
26
28
27
29
my $tree = $commit -> tree;
28
30
is( $tree -> kind, ' tree' );
@@ -48,11 +50,9 @@ hello world, again
48
50
like( $commit -> sha1, qr / ^[a-z0-9]{40}$ / );
49
51
is( $commit -> tree_sha1, ' d0492b368b66bdabf2ac1fd8c92b39d3db916e59' );
50
52
like( $commit -> parent_sha1, qr / ^[a-z0-9]{40}$ / );
51
- like( $commit -> author,
52
- qr / ^Your Name Comes Here <you\@ yourdomain.example.com>/ );
53
- like( $commit -> committer,
54
- qr / ^Your Name Comes Here <you\@ yourdomain.example.com>/ );
55
- is( $commit -> comment, ' add emphasis' );
53
+ is(
$commit -> author
-> email,
' [email protected] ' );
54
+ is(
$commit -> committer
-> email,
' [email protected] ' );
55
+ is( $commit -> comment, ' add emphasis' );
56
56
57
57
$tree = $commit -> tree;
58
58
is( $tree -> kind, ' tree' );
@@ -75,14 +75,12 @@ hello world, again
75
75
is( $commit -> kind, ' commit' );
76
76
is( $commit -> size, 213 );
77
77
like( $commit -> sha1, qr / ^[a-z0-9]{40}$ / );
78
- is( $commit -> tree_sha1, ' 92b8b694ffb1675e5975148e1121810081dbdffe' );
79
- is( $commit -> parent_sha1, undef );
80
- is( $commit -> parent, undef );
81
- like( $commit -> author,
82
- qr / ^Your Name Comes Here <you\@ yourdomain.example.com>/ );
83
- like( $commit -> committer,
84
- qr / ^Your Name Comes Here <you\@ yourdomain.example.com>/ );
85
- is( $commit -> comment, ' initial commit' );
78
+ is( $commit -> tree_sha1, ' 92b8b694ffb1675e5975148e1121810081dbdffe' );
79
+ is( $commit -> parent_sha1, undef );
80
+ is( $commit -> parent, undef );
81
+ is( $commit -> author-> name, ' Your Name Comes Here' );
82
+ is( $commit -> committer-> name, ' Your Name Comes Here' );
83
+ is( $commit -> comment, ' initial commit' );
86
84
87
85
$tree = $commit -> tree;
88
86
is( $tree -> kind, ' tree' );
0 commit comments