EventuallyMatchers

org.specs2.matcher.EventuallyMatchers
See theEventuallyMatchers companion object
trait EventuallyMatchers extends EventuallyResults

This trait adds the possibility to retry a given matcher until it succeeds.

This was contributed by @robey (http://robey.lag.net)

Attributes

Companion
object
Graph
Supertypes
trait EventuallyResults
class Object
trait Matchable
class Any
Known subtypes
object EventuallyMatchers.type
trait Matchers
object Matchers.type
trait MustMatchers
object MustMatchers.type
object MustThrownMatchers.type
object ShouldMatchers.type
object ShouldThrownMatchers.type
Show all

Members list

Value members

Concrete methods

def eventually[T](nested: => Matcher[T], retries: Int, sleep: Int => Duration): Matcher[T]

Value parameters

sleep

the function applied on the retry number (first is 1)

Attributes

Returns

a matcher that will retry the nested matcher a given number of times

def eventually[T](nested: => Matcher[T], retries: Int, sleep: Duration): Matcher[T]

Attributes

Returns

a matcher that will retry the nested matcher a given number of times

def eventually[T](nested: => Matcher[T]): Matcher[T]

Attributes

Returns

a matcher that will retry the nested matcher 40 times

Inherited methods

def eventually[T](result: => T)(using evidence$3: AsResult[T]): T

Attributes

Returns

a result that is retried at least 40 times until it's ok

Inherited from:
EventuallyResults
def eventually[T](retries: Int, sleep: Duration)(result: => T)(using evidence$2: AsResult[T]): T

Attributes

Returns

a matcher that will retry the nested matcher a given number of times

Inherited from:
EventuallyResults
def eventually[T](retries: Int, sleep: Int => Duration)(result: => T)(using evidence$1: AsResult[T]): T

Value parameters

sleep

the function applied on the retry number (first is 1)

Attributes

Returns

a matcher that will retry the nested matcher a given number of times

eventually(retries = 2, sleep = _ * 100.milliseconds) {
 aResult
}
Inherited from:
EventuallyResults