Skip to content

Commit

Permalink
Improve scaladocs of eventually (#1287)
Browse files Browse the repository at this point in the history
* Improve scaladocs of `eventually`

* Update EventuallyResults.scala
  • Loading branch information
donce authored Nov 8, 2024
1 parent dc6b809 commit 15176e5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ trait EventuallyResults:
else retry(0)

/** @return
* a matcher that will retry the nested matcher a given number of times
* a matcher that will retry the nested matcher a given number of times with a given duration of sleep in between
*/
def eventually[T: AsResult](retries: Int, sleep: Duration)(result: =>T): T =
eventually[T](retries, (_: Int) => sleep)(result)

/** @return a result that is retried at least 40 times until it's ok */
/** @return
* a matcher that will retry the nested matcher 40 times until it's ok with 100ms sleep in between
*/
def eventually[T: AsResult](result: =>T): T =
eventually(40, (_: Int) => 100.millis)(result)

Expand Down

0 comments on commit 15176e5

Please sign in to comment.