Skip to content

Commit

Permalink
Test for #193
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoberstar committed Sep 14, 2017
1 parent 1e730f2 commit 635b98b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/test/groovy/org/ajoberstar/grgit/util/JGitUtilSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ class JGitUtilSpec extends Specification {
Instant instant = Instant.ofEpochSecond(commits[1].commitTime)
ZoneId zone = ZoneId.ofOffset('GMT', ZoneId.systemDefault().getRules().getOffset(instant))
ZonedDateTime commitTime = ZonedDateTime.ofInstant(instant, zone)
expect:
JGitUtil.convertCommit(commits[1]) == new Commit(
Commit expectedCommit = new Commit(
ObjectId.toString(commits[1]),
[ObjectId.toString(commits[0])],
person,
Expand All @@ -120,6 +119,10 @@ class JGitUtilSpec extends Specification {
'second commit',
'second commit'
)
expect:
def result = JGitUtil.convertCommit(commits[1])
result == expectedCommit
result.date.toInstant() == commitTime.toInstant()
}

def 'resolveTag works for annotated tag ref'() {
Expand Down

0 comments on commit 635b98b

Please sign in to comment.