object HavePropertyMatcher
Companion object for trait HavePropertyMatcher
that provides a
factory method that creates a HavePropertyMatcher[T]
from a
passed function of type (T => HavePropertyMatchResult)
.
- Alphabetic
- By Inheritance
- HavePropertyMatcher
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- def apply[T, P](fun: (T) => HavePropertyMatchResult[P])(implicit evT: ClassTag[T], evP: ClassTag[P]): HavePropertyMatcher[T, P]
Factory method that creates a
HavePropertyMatcher[T]
from a passed function of type(T => HavePropertyMatchResult)
.Factory method that creates a
HavePropertyMatcher[T]
from a passed function of type(T => HavePropertyMatchResult)
.This allows you to create a
HavePropertyMatcher
in a slightly more concise way, for example:case class Person(name: String) def name(expectedName: String) = { HavePropertyMatcher { (person: Person) => HavePropertyMatchResult( person.name == expectedName, "name", expectedName, person.name ) }