From 635b98b0653ef842d2b6404e0d14c8ac29fdf857 Mon Sep 17 00:00:00 2001 From: Andrew Oberstar Date: Wed, 13 Sep 2017 21:48:30 -0500 Subject: [PATCH] Test for #193 --- .../groovy/org/ajoberstar/grgit/util/JGitUtilSpec.groovy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/groovy/org/ajoberstar/grgit/util/JGitUtilSpec.groovy b/src/test/groovy/org/ajoberstar/grgit/util/JGitUtilSpec.groovy index 4ae6b740..f630fdf4 100644 --- a/src/test/groovy/org/ajoberstar/grgit/util/JGitUtilSpec.groovy +++ b/src/test/groovy/org/ajoberstar/grgit/util/JGitUtilSpec.groovy @@ -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, @@ -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'() {