Bump version to 0.003006, update Changes and README.
[catagits/Gitalist.git] / t / 02git_head.t
CommitLineData
bc33a9b1 1use FindBin qw/$Bin/;
2BEGIN {
3 my $env = "$FindBin::Bin/../script/env";
4 if (-r $env) {
5 do $env or die $@;
6 }
7}
8
03bf0cab 9use strict;
10use warnings;
11use Test::More qw/no_plan/;
12use Test::Exception;
13use Data::Dumper;
14
15BEGIN { use_ok 'Gitalist::Git::Head' }
16
17
72fbbef7 18my $revline="a92fb1c9282f7319099ce7f783c8be7d5360f6e3\0refs/heads/model-cleanup\0Zachary Stevens <zts\@cryptocracy.com> 1277601094 +0100";
19my $instance = Gitalist::Git::Head->new($revline);
20isa_ok($instance, 'Gitalist::Git::Head');
21
03bf0cab 22# Create an instance, passing last_change as a DateTime
23use DateTime;
24my $timespec = [1277578462, '+0100'];
25my $dt = DateTime->from_epoch(
26 epoch => @$timespec[0],
27 time_zone => @$timespec[1],
28);
29my $head = Gitalist::Git::Head->new(
30 sha1 => 'bca1153c22e393a952b6715bf2212901e4e77215',
31 name => 'master',
32 committer => 'Zachary Stevens <zts@cryptocracy.com>',
33 last_change => $dt,
34);
35isa_ok($head, 'Gitalist::Git::Head');