diff options
author | vlad <vlad@driver.xyz> | 2017-06-13 16:12:20 -0700 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2017-06-13 16:12:20 -0700 |
commit | cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c (patch) | |
tree | 062e8dad1a1513e26b0fd08b1742d6ff2ee874f7 /src/test/scala/xyz/driver/common/utils/DiffUtils.scala | |
parent | 0000a65ab4479a2a40e2d6468036438e9705b4aa (diff) | |
download | rest-query-cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c.tar.gz rest-query-cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c.tar.bz2 rest-query-cd1b635b2ae90d9ac2d8b1779183a1fbd8c5fd5c.zip |
Adding domain entitiesv0.1.0
Diffstat (limited to 'src/test/scala/xyz/driver/common/utils/DiffUtils.scala')
-rw-r--r-- | src/test/scala/xyz/driver/common/utils/DiffUtils.scala | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/test/scala/xyz/driver/common/utils/DiffUtils.scala b/src/test/scala/xyz/driver/common/utils/DiffUtils.scala deleted file mode 100644 index 06199bb..0000000 --- a/src/test/scala/xyz/driver/common/utils/DiffUtils.scala +++ /dev/null @@ -1,52 +0,0 @@ -package xyz.driver.common.utils - -import java.net.URI -import java.time.{LocalDate, LocalDateTime} - -import ai.x.diff._ -import org.scalatest.Assertions -import xyz.driver.common.domain.PasswordHash - -import scala.io.AnsiColor - -trait DiffUtils { - - this: Assertions => - - def assertIdentical[T: DiffShow](left: T, right: T): Unit = { - val diff = DiffShow.diff(left, right) - assert(diff.isIdentical, s"\n${AnsiColor.RESET}$diff") // reset red color - } - - implicit def localTimeDiffShow: DiffShow[LocalDateTime] = new DiffShow[LocalDateTime] { - def show(x: LocalDateTime): String = s"LocalTime($x)" - def diff(left: LocalDateTime, right: LocalDateTime): Comparison = { - if (left.isEqual(right)) Identical(show(left)) - else Different(showChange(left, right)) - } - } - - implicit def localDateDiffShow: DiffShow[LocalDate] = new DiffShow[LocalDate] { - def show(x: LocalDate): String = s"LocalDate($x)" - def diff(left: LocalDate, right: LocalDate): Comparison = { - if (left.isEqual(right)) Identical(show(left)) - else Different(showChange(left, right)) - } - } - - implicit def urlDiffShow: DiffShow[URI] = new DiffShow[URI] { - def show(x: URI): String = s"URI($x)" - def diff(left: URI, right: URI): Comparison = { - if (left.equals(right)) Identical(show(left)) - else Different(showChange(left, right)) - } - } - - implicit def passwordHashDiffShow: DiffShow[PasswordHash] = new DiffShow[PasswordHash] { - def show(x: PasswordHash): String = s"PasswordHash($x)" - def diff(left: PasswordHash, right: PasswordHash): Comparison = { - if (left.equals(right)) Identical(show(left)) - else Different(showChange(left, right)) - } - } -} |