Packages

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).

Source
HavePropertyMatcher.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HavePropertyMatcher
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. 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
        )
      }