Skip to content

Commit

Permalink
Iterate delay test changes
Browse files Browse the repository at this point in the history
* Move into own section
* and the matchers
  • Loading branch information
adelbertc committed Mar 9, 2015
1 parent 212533d commit c19224e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/src/test/scala/rebind/RetryPolicySpec.scala
Expand Up @@ -46,7 +46,8 @@ class RetryPolicySpec extends Specification with ScalaCheck with RetryPolicySpec
uses handler ${retryingUsesHandler}
retries until success ${retryingUntilSuccess}
exhausts policy ${retryingExhaustPolicy}
can iterate ${iterateDelay}

can iterate ${iterateDelay}
"""

def makeFailedAction[E, A](n: Int, error: E, success: A): TestAction[E, A] =
Expand Down Expand Up @@ -228,9 +229,9 @@ class RetryPolicySpec extends Specification with ScalaCheck with RetryPolicySpec
def iterateDelay = {
val policy = RetryPolicy.iterateDelay(1.second)(_ * 2)

policy.run(0) mustEqual Some(1.second)
policy.run(1) mustEqual Some(2.seconds)
policy.run(2) mustEqual Some(4.seconds)
(policy.run(0) mustEqual Some(1.second)) and
(policy.run(1) mustEqual Some(2.seconds)) and
(policy.run(2) mustEqual Some(4.seconds))
}
}

Expand Down

0 comments on commit c19224e

Please sign in to comment.