MapMatchers

Matchers for Maps

Companion:
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def beDefinedAt[K](values: K*): Matcher[PartialFunction[K, Any]]

matches if the partial function is defined at those values

matches if the partial function is defined at those values

def beDefinedBy[K, V](values: (K, V)*): Matcher[PartialFunction[K, V]]

matches if the partial function is defined at those values and return expected values

matches if the partial function is defined at those values and return expected values

def haveKey[K](k: K): Matcher[Iterable[(K, Any)]]

matches if map.contains(k)

matches if map.contains(k)

def haveKeys[K](keys: K*): Matcher[Iterable[(K, Any)]]

matches if map.contains(k) forall key k

matches if map.contains(k) forall key k

def havePair[K, V](p: (K, V)): Matcher[Iterable[(K, V)]]

matches if map contains a pair (key, value) == (k, v)

matches if map contains a pair (key, value) == (k, v)

def havePairs[K, V](pairs: (K, V)*): Matcher[Iterable[(K, V)]]

matches if map contains all the specified pairs

matches if map contains all the specified pairs

def haveValue[V](v: V): Matcher[Iterable[(Any, V)]]

matches if map contains a pair (key, value) with value == v

matches if map contains a pair (key, value) with value == v

def haveValues[V](values: V*): Matcher[Iterable[(Any, V)]]

matches if map contains a pair (key, value) with value == v for all value v

matches if map contains a pair (key, value) with value == v for all value v