AnyMatchers

org.specs2.matcher.AnyMatchers
See theAnyMatchers companion object
trait AnyMatchers

This trait provides matchers which are applicable to any type of value

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AnyMatchers.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 !==[T](t: => T)(using evidence$4: Diffable[T]): Matcher[T]

matches if a != b

matches if a != b

Attributes

def ===[T](t: => T)(using evidence$3: Diffable[T]): EqualityMatcher[T]

matches if a == b

matches if a == b

Attributes

def ==~[T, S](s: => S)(using evidence$8: Diffable[T], convert: Conversion[S, T]): Matcher[T]

matches if a == b after an implicit conversion

matches if a == b after an implicit conversion

Attributes

def anyOf[T](t: T*): Matcher[T]

alias for beOneOf, which can be used with contain matchers

alias for beOneOf, which can be used with contain matchers

Attributes

def be[T <: AnyRef](t: => T): BeTheSameAs[T]

alias for beTheSameAs

alias for beTheSameAs

Attributes

def beAnInstanceOf[T](using evidence$14: ClassTag[T]): Matcher[AnyRef]
def beAnyOf[T](t: T*): Matcher[T]

alias for beOneOf

alias for beOneOf

Attributes

def beAsNullAs[T](a: => T): Matcher[T]

matches if a is null when v is null and a is not null when v is not null

matches if a is null when v is null and a is not null when v is not null

Attributes

def beAssignableFrom[T](using evidence$13: ClassTag[T]): Matcher[Class[_]]

matches if v.isAssignableFrom(c)

matches if v.isAssignableFrom(c)

Attributes

def beEmpty[T](using evidence$9: IsEmpty[T]): Matcher[T]

matches if a.isEmpty

matches if a.isEmpty

Attributes

def beEqualTo[T](t: => T)(using evidence$5: Diffable[T]): EqualityMatcher[T]

matches if a == b

matches if a == b

Attributes

def beFalse: Matcher[Boolean]

matches if a == false

matches if a == false

Attributes

def beLike[T](pattern: PartialFunction[T, Result]): Matcher[T]

matches if the value returns a successful result when applied to a PartialFunction

matches if the value returns a successful result when applied to a PartialFunction

Attributes

def beNull[T]: BeNull[T]

matches if the value is null

matches if the value is null

Attributes

def beOneOf[T](t: T*): Matcher[T]

matches if t.toSeq.exists(_ == v)

matches if t.toSeq.exists(_ == v)

Attributes

def beTheSameAs[T <: AnyRef](t: => T): BeTheSameAs[T]

matches if a eq b

matches if a eq b

Attributes

def beTrue: Matcher[Boolean]

matches if a == true

matches if a == true

Attributes

def be_!=[T](t: => T)(using evidence$2: Diffable[T]): Matcher[T]

matches if a != b

matches if a != b

Attributes

def be_==[T](t: => T)(using evidence$1: Diffable[T]): EqualityMatcher[T]

matches if a == b

matches if a == b

Attributes

def be_==~[T, S](s: => S)(using evidence$7: Diffable[T], convert: Conversion[S, T]): Matcher[T]

matches if a == b after an implicit conversion

matches if a == b after an implicit conversion

Attributes

def equalTo[T](t: => T)(using evidence$6: Diffable[T]): EqualityMatcher[T]

matches if a == b

matches if a == b

Attributes

def haveClass[T](using evidence$10: ClassTag[T]): Matcher[AnyRef]

matches if v.getClass == c

matches if v.getClass == c

Attributes

def haveInterface[T](using evidence$12: ClassTag[T]): Matcher[AnyRef]

matches if x.getClass.getInterfaces.contains(T)

matches if x.getClass.getInterfaces.contains(T)

Attributes

def haveSuperclass[T](using evidence$11: ClassTag[T]): Matcher[AnyRef]

matches if c.isAssignableFrom(v.getClass.getSuperclass)

matches if c.isAssignableFrom(v.getClass.getSuperclass)

Attributes

def not[T](m: Matcher[T]): Matcher[T]

negate a matcher

negate a matcher

Attributes