Skip to content
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.

Commit

Permalink
Better parameter names to indicate we are asserting on the mutated state
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Galic committed Jun 28, 2019
1 parent 75d0ce9 commit 64d4f37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/com/gu/tip/assertion/TipAssert.scala
Expand Up @@ -27,17 +27,17 @@ trait TipAssertIf {
protected val logger: Logger

def apply[T](
f: => Future[T],
p: T => Boolean,
state: => Future[T],
predicate: T => Boolean,
msg: String,
max: Int = 1,
delay: FiniteDuration = Defaults.delay
): Future[AssertionResult] = {

implicit val ec = ExecutionContext.assertionExecutionContext
retry.Pause(max, delay)(odelay.Timer.default) {
f.map { v =>
Try(assert(p(v)))
state.map { actualState =>
Try(assert(predicate(actualState)))
}
} map {
case Failure(_) =>
Expand Down

0 comments on commit 64d4f37

Please sign in to comment.