Packages

object Assertion extends AssertionVariants

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Assertion
  2. AssertionVariants
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type Render = AssertionM.Render

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val Render: AssertionM.Render.type
  5. val anything: Assertion[Any]

    Makes a new assertion that always succeeds.

  6. def approximatelyEquals[A](reference: A, tolerance: A)(implicit arg0: Numeric[A]): Assertion[A]

    Makes a new assertion that requires a given numeric value to match a value with some tolerance.

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def assertion[A](name: String)(params: RenderParam*)(run: (=> A) => Boolean): Assertion[A]

    Makes a new Assertion from a pretty-printing and a function.

  9. def assertionDirect[A](name: String)(params: RenderParam*)(run: (=> A) => AssertResult): Assertion[A]

    Makes a new Assertion from a pretty-printing and a function.

  10. def assertionRec[A, B](name: String)(params: RenderParam*)(assertion: Assertion[B])(get: (=> A) => Option[B], orElse: (AssertionData) => AssertResult = _.asFailure): Assertion[A]

    Makes a new Assertion[A] from a pretty-printing, a function (=> A) => Option[B], and an Assertion[B].

    Makes a new Assertion[A] from a pretty-printing, a function (=> A) => Option[B], and an Assertion[B]. If the result of applying the function to a given value is Some[B], the Assertion[B] will be applied to the resulting value to determine if the assertion is satisfied. The result of the Assertion[B] and any assertions it is composed from will be recursively embedded in the assert result. If the result of the function is None the orElse parameter will be used to determine whether the assertion is satisfied.

  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  12. def contains[A](element: A): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable contain the specified element.

    Makes a new assertion that requires an Iterable contain the specified element. See Assertion.exists if you want to require an Iterable to contain an element satisfying an assertion.

  13. def containsCause[E](cause: Cause[E]): Assertion[Cause[E]]

    Makes a new assertion that requires a Cause contain the specified cause.

  14. def containsString(element: String): Assertion[String]

    Makes a new assertion that requires a substring to be present.

  15. def dies(assertion: Assertion[Throwable]): Assertion[Exit[Any, Any]]

    Makes a new assertion that requires an exit value to die.

  16. def endsWith[A](suffix: Seq[A]): Assertion[Seq[A]]

    Makes a new assertion that requires a given string to end with the specified suffix.

  17. def endsWithString(suffix: String): Assertion[String]

    Makes a new assertion that requires a given string to end with the specified suffix.

  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def equalTo[A, B](expected: A)(implicit eql: Eql[A, B]): Assertion[B]

    Makes a new assertion that requires a value equal the specified value.

    Makes a new assertion that requires a value equal the specified value.

    Definition Classes
    AssertionVariants
  20. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  21. def equalsIgnoreCase(other: String): Assertion[String]

    Makes a new assertion that requires a given string to equal another ignoring case.

  22. def exists[A](assertion: Assertion[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable contain an element satisfying the given assertion.

    Makes a new assertion that requires an Iterable contain an element satisfying the given assertion. See Assertion.contains if you only need an Iterable to contain a given element.

  23. def fails[E](assertion: Assertion[E]): Assertion[Exit[E, Any]]

    Makes a new assertion that requires an exit value to fail.

  24. def failsCause[E](assertion: Assertion[Cause[E]]): Assertion[Exit[E, Any]]

    Makes a new assertion that requires an exit value to fail with a cause that meets the specified assertion.

  25. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  26. def forall[A](assertion: Assertion[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable contain only elements satisfying the given assertion.

  27. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. def hasAt[A](pos: Int)(assertion: Assertion[A]): Assertion[Seq[A]]

    Makes a new assertion that requires a sequence to contain an element satisfying the given assertion on the given position

  29. def hasAtLeastOneOf[A](other: Iterable[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable contain at least one of the specified elements.

  30. def hasAtMostOneOf[A](other: Iterable[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable contain at most one of the specified elements.

  31. def hasField[A, B](name: String, proj: (A) => B, assertion: Assertion[B]): Assertion[A]

    Makes a new assertion that focuses in on a field in a case class.

    Makes a new assertion that focuses in on a field in a case class.

    hasField("age", _.age, within(0, 10))
  32. def hasFirst[A](assertion: Assertion[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable to contain the first element satisfying the given assertion.

  33. def hasIntersection[A](other: Iterable[A])(assertion: Assertion[Iterable[A]]): Assertion[Iterable[A]]

    Makes a new assertion that requires the intersection of two Iterables satisfy the given assertion.

  34. def hasKey[K, V](key: K): Assertion[Map[K, V]]

    Makes a new assertion that requires a Map to have the specified key.

  35. def hasKey[K, V](key: K, assertion: Assertion[V]): Assertion[Map[K, V]]

    Makes a new assertion that requires a Map to have the specified key with value satisfying the specified assertion.

  36. def hasKeys[K, V](assertion: Assertion[Iterable[K]]): Assertion[Map[K, V]]

    Makes a new assertion that requires a Map have keys satisfying the specified assertion.

  37. def hasLast[A](assertion: Assertion[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable to contain the last element satisfying the given assertion.

  38. def hasMessage(message: Assertion[String]): Assertion[Throwable]

    Makes a new assertion that requires an exception to have a certain message.

  39. def hasNoneOf[A](other: Iterable[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable contain none of the specified elements.

  40. def hasOneOf[A](other: Iterable[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable contain exactly one of the specified elements.

  41. def hasSameElements[A](other: Iterable[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable to have the same elements as the specified Iterable, though not necessarily in the same order.

  42. def hasSameElementsDistinct[A](other: Iterable[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable to have the same distinct elements as the other Iterable, though not necessarily in the same order.

  43. def hasSize[A](assertion: Assertion[Int]): Assertion[Iterable[A]]

    Makes a new assertion that requires the size of an Iterable be satisfied by the specified assertion.

  44. def hasSizeString(assertion: Assertion[Int]): Assertion[String]

    Makes a new assertion that requires the size of a string be satisfied by the specified assertion.

  45. def hasSubset[A](other: Iterable[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires the specified Iterable to be a subset of the other Iterable.

  46. def hasSuppressed(cause: Assertion[Iterable[Throwable]]): Assertion[Throwable]

    Makes a new assertion that requires an exception to have certain suppressed exceptions.

  47. def hasThrowableCause(cause: Assertion[Throwable]): Assertion[Throwable]

    Makes a new assertion that requires an exception to have a certain cause.

  48. def hasValues[K, V](assertion: Assertion[Iterable[V]]): Assertion[Map[K, V]]

    Makes a new assertion that requires a Map have values satisfying the specified assertion.

  49. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  50. def isCase[Sum, Proj](termName: String, term: (Sum) => Option[Proj], assertion: Assertion[Proj]): Assertion[Sum]

    Makes a new assertion that requires the sum type be a specified term.

    Makes a new assertion that requires the sum type be a specified term.

    isCase("Some", Some.unapply, anything)
  51. val isDistinct: Assertion[Iterable[Any]]

    Makes a new assertion that requires an Iterable is distinct.

  52. val isEmpty: Assertion[Iterable[Any]]

    Makes a new assertion that requires an Iterable to be empty.

  53. val isEmptyString: Assertion[String]

    Makes a new assertion that requires a given string to be empty.

  54. def isFailure(assertion: Assertion[Throwable]): Assertion[Try[Any]]

    Makes a new assertion that requires a Failure value satisfying the specified assertion.

  55. val isFailure: Assertion[Try[Any]]

    Makes a new assertion that requires a Try value is Failure.

  56. def isFalse: Assertion[Boolean]

    Makes a new assertion that requires a value be false.

  57. def isFiniteDouble: Assertion[Double]

    Makes a new assertions that requires a double value is finite.

  58. def isFiniteFloat: Assertion[Float]

    Makes a new assertions that requires a float value is finite.

  59. def isGreaterThan[A](reference: A)(implicit ord: Ordering[A]): Assertion[A]

    Makes a new assertion that requires the value be greater than the specified reference value.

  60. def isGreaterThanEqualTo[A](reference: A)(implicit ord: Ordering[A]): Assertion[A]

    Makes a new assertion that requires the value be greater than or equal to the specified reference value.

  61. def isInfiniteDouble: Assertion[Double]

    Makes a new assertions that requires a double value is infinite.

  62. def isInfiniteFloat: Assertion[Float]

    Makes a new assertions that requires a float value is infinite.

  63. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  64. def isInterrupted: Assertion[Exit[Any, Any]]

    Makes a new assertion that requires an exit value to be interrupted.

  65. def isJustInterrupted: Assertion[Exit[Any, Any]]

    Makes a new assertion that requires an exit value to be interrupted.

  66. def isLeft[A](assertion: Assertion[A]): Assertion[Either[A, Any]]

    Makes a new assertion that requires a Left value satisfying a specified assertion.

  67. val isLeft: Assertion[Either[Any, Any]]

    Makes a new assertion that requires an Either is Left.

  68. def isLessThan[A](reference: A)(implicit ord: Ordering[A]): Assertion[A]

    Makes a new assertion that requires the value be less than the specified reference value.

  69. def isLessThanEqualTo[A](reference: A)(implicit ord: Ordering[A]): Assertion[A]

    Makes a new assertion that requires the value be less than or equal to the specified reference value.

  70. def isNaNDouble: Assertion[Double]

    Makes a new assertions that requires a double value is not a number (NaN).

  71. def isNaNFloat: Assertion[Float]

    Makes a new assertions that requires a float value is not a number (NaN).

  72. def isNegInfinityDouble: Assertion[Double]

    Makes a new assertions that requires a double value is negative infinity.

  73. def isNegInfinityFloat: Assertion[Float]

    Makes a new assertions that requires a float value is negative infinity.

  74. def isNegative[A](implicit num: Numeric[A]): Assertion[A]

    Makes a new assertion that requires a numeric value is negative.

  75. val isNonEmpty: Assertion[Iterable[Any]]

    Makes a new assertion that requires an Iterable to be non empty.

  76. val isNonEmptyString: Assertion[String]

    Makes a new assertion that requires a given string to be non empty.

  77. val isNone: Assertion[Option[Any]]

    Makes a new assertion that requires a None value.

  78. val isNull: Assertion[Any]

    Makes a new assertion that requires a null value.

  79. def isOneOf[A](values: Iterable[A]): Assertion[A]

    Makes a new assertion that requires a value to be equal to one of the specified values.

  80. def isPosInfinityDouble: Assertion[Double]

    Makes a new assertions that requires a double value is positive infinity.

  81. def isPosInfinityFloat: Assertion[Float]

    Makes a new assertions that requires a float value is positive infinity.

  82. def isPositive[A](implicit num: Numeric[A]): Assertion[A]

    Makes a new assertion that requires a numeric value is positive.

  83. def isRight[A](assertion: Assertion[A]): Assertion[Either[Any, A]]

    Makes a new assertion that requires a Right value satisfying a specified assertion.

  84. val isRight: Assertion[Either[Any, Any]]

    Makes a new assertion that requires an Either is Right.

  85. def isSome[A](assertion: Assertion[A]): Assertion[Option[A]]

    Makes a new assertion that requires a Some value satisfying the specified assertion.

  86. val isSome: Assertion[Option[Any]]

    Makes a new assertion that requires an Option is Some.

  87. def isSorted[A](implicit ord: Ordering[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable is sorted.

  88. def isSortedReverse[A](implicit ord: Ordering[A]): Assertion[Iterable[A]]

    Makes a new assertion that requires an Iterable is sorted in reverse order.

  89. def isSubtype[A](assertion: Assertion[A])(implicit C: ClassTag[A]): Assertion[Any]

    Makes a new assertion that requires a value have the specified type.

    Makes a new assertion that requires a value have the specified type.

    Example:

    assert(Duration.fromNanos(1))(isSubtype[Duration.Finite](Assertion.anything))
  90. def isSuccess[A](assertion: Assertion[A]): Assertion[Try[A]]

    Makes a new assertion that requires a Success value satisfying the specified assertion.

  91. val isSuccess: Assertion[Try[Any]]

    Makes a new assertion that requires a Try value is Success.

  92. def isTrue: Assertion[Boolean]

    Makes a new assertion that requires a value be true.

  93. val isUnit: Assertion[Unit]

    Makes a new assertion that requires the value be unit.

  94. def isWithin[A](min: A, max: A)(implicit ord: Ordering[A]): Assertion[A]

    Makes a new assertion that requires a value to fall within a specified min and max (inclusive).

  95. def isZero[A](implicit num: Numeric[A]): Assertion[A]

    Makes a new assertion that requires a numeric value is zero.

  96. def matchesRegex(regex: String): Assertion[String]

    Makes a new assertion that requires a given string to match the specified regular expression.

  97. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  98. def nonNegative[A](implicit num: Numeric[A]): Assertion[A]

    Makes a new assertion that requires a numeric value is non negative.

  99. def nonPositive[A](implicit num: Numeric[A]): Assertion[A]

    Makes a new assertion that requires a numeric value is non positive.

  100. def not[A](assertion: Assertion[A]): Assertion[A]

    Makes a new assertion that negates the specified assertion.

  101. val nothing: Assertion[Any]

    Makes a new assertion that always fails.

  102. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  103. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  104. def startsWith[A](prefix: Seq[A]): Assertion[Seq[A]]

    Makes a new assertion that requires a given sequence to start with the specified prefix.

  105. def startsWithString(prefix: String): Assertion[String]

    Makes a new assertion that requires a given string to start with a specified prefix.

  106. def succeeds[A](assertion: Assertion[A]): Assertion[Exit[Any, A]]

    Makes a new assertion that requires an exit value to succeed.

  107. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  108. def throws[A](assertion: Assertion[Throwable]): Assertion[A]

    Makes a new assertion that requires the expression to throw.

  109. def throwsA[E](implicit arg0: ClassTag[E]): Assertion[Any]

    Makes a new assertion that requires the expression to throw an instance of given type (or its subtype).

  110. def toString(): String
    Definition Classes
    AnyRef → Any
  111. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  112. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  113. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AssertionVariants

Inherited from AnyRef

Inherited from Any

Ungrouped