JsonMatcher

abstract class JsonMatcher extends Matcher[String]
Companion:
object
trait Matcher[String]
class Object
trait Matchable
class Any

Value members

Abstract methods

def negated: Boolean

Concrete methods

def anyValueToJsonType(value: Any): JsonType
def apply[S <: String](s: Expectable[S]): Result

Inherited methods

def ^^[S](f: S => Expectable[String], dummy: Int): Matcher[S]

Adapt a matcher to another. ex: be_==("message") ^^ (_.getMessage aka "trimmed") can be applied to an exception

Adapt a matcher to another. ex: be_==("message") ^^ (_.getMessage aka "trimmed") can be applied to an exception

The dummy value is used to help to disambiguate with the overloaded ^^ function

Inherited from:
Matcher
def ^^[S](f: S => String): Matcher[S]

Adapt a matcher to another. ex: be_==("message") ^^ (_.getMessage) can be applied to an exception

Adapt a matcher to another. ex: be_==("message") ^^ (_.getMessage) can be applied to an exception

Inherited from:
Matcher
infix def and[S <: String](m: => Matcher[S]): Matcher[S]

the logical and between 2 matchers

the logical and between 2 matchers

See also:

Result.and

Inherited from:
Matcher
def eventually(retries: Int, sleep: Int => Duration): Matcher[String]
Value parameters:
sleep

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

Returns:

a matcher that needs to eventually match, after a given number of retries and a sleep time

(aResult === expected).eventually(retries = 2, _ * 100.milliseconds)
Inherited from:
Matcher
def eventually(retries: Int, sleep: Duration): Matcher[String]
Returns:

a matcher that needs to eventually match, after a given number of retries and a sleep time

Inherited from:
Matcher
def eventually: Matcher[String]
Returns:

a matcher that needs to eventually match, after 40 retries and a sleep time of 100 milliseconds

Inherited from:
Matcher
def iff(b: Boolean): Matcher[String]

when the condition is true the matcher is applied, when it's false, the matcher must fail

when the condition is true the matcher is applied, when it's false, the matcher must fail

Inherited from:
Matcher
def lazily: Matcher[() => String]

The lazily operator returns a Matcher which will match a function returning the expected value

The lazily operator returns a Matcher which will match a function returning the expected value

Inherited from:
Matcher
def mute: Matcher[String]
Returns:

a Matcher with no messages

Inherited from:
Matcher
def not: Matcher[String]

negate a Matcher

negate a Matcher

See also:

Result.not

Inherited from:
Matcher
infix def or[S <: String](m: => Matcher[S]): Matcher[S]

the logical or between 2 matchers

the logical or between 2 matchers

See also:

Result.or

Inherited from:
Matcher
def orPending(message: String => String): Matcher[String]
Returns:

a Pending Result if this matcher fails, modifying the failure message with a pending message.

Inherited from:
Matcher
def orPending(m: String): Matcher[String]
Returns:

a Pending Result if this matcher fails, prefixing the failure message with a pending message. If the pending message is empty, only the failure message is printed

Inherited from:
Matcher
def orPending: Matcher[String]
Returns:

a Pending Result if this matcher fails

Inherited from:
Matcher
def orSkip(message: String => String): Matcher[String]
Returns:

a Skipped Result if this matcher fails, modifying the failure message with a skip message.

Inherited from:
Matcher
def orSkip(m: String): Matcher[String]
Returns:

a Skipped Result if this matcher fails, prefixing the failure message with a skip message. If the skip message is empty, only the failure message is printed

Inherited from:
Matcher
def orSkip: Matcher[String]
Returns:

a Skipped result if this matcher fails

Inherited from:
Matcher
def orThrow(message: String => String): Matcher[String]

throw a FailureException if this matcher fails, modifying the failure message with a message.

throw a FailureException if this matcher fails, modifying the failure message with a message.

Inherited from:
Matcher
def orThrow(m: String): Matcher[String]

throw a FailureException if this matcher fails prefixing the failure message with a message. If the message is empty, only the failure message is printed

throw a FailureException if this matcher fails prefixing the failure message with a message. If the message is empty, only the failure message is printed

Inherited from:
Matcher
def orThrow: Matcher[String]

throw a FailureException if this matcher fails

throw a FailureException if this matcher fails

Inherited from:
Matcher
def setMessage(message: String): Matcher[String]
Returns:

set a new failure message of a matcher

Inherited from:
Matcher
def test: String => Boolean
Returns:

a test function corresponding to this matcher

Inherited from:
Matcher
def unless(b: Boolean, m: String): Matcher[String]

only apply this matcher if the condition is false

only apply this matcher if the condition is false

Inherited from:
Matcher
def updateMessage(f: String => String): Matcher[String]
Returns:

update the failure message of a matcher

Inherited from:
Matcher
def when(b: Boolean, m: String): Matcher[String]

only apply this matcher if the condition is true

only apply this matcher if the condition is true

Inherited from:
Matcher