Assertion

zio.test.Assertion
See theAssertion companion class
object Assertion extends AssertionVariants

Attributes

Companion
class
Source
Assertion.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
Assertion.type

Members list

Type members

Classlikes

object Arguments

Attributes

Companion
trait
Source
Assertion.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Arguments.type
sealed trait Arguments

Attributes

Companion
object
Source
Assertion.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class TypeArgument[A]
class ValueArgument[A]
Self type

Inherited and Abstract types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
Source
Mirror.scala

The name of the type

The name of the type

Attributes

Inherited from:
Mirror
Source
Mirror.scala

Value members

Concrete methods

def approximatelyEquals[A : Numeric](reference: A, tolerance: A): Assertion[A]

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

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

Attributes

Source
Assertion.scala
def assertion[A](name: String)(run: (=> A) => Boolean): Assertion[A]

Makes a new Assertion from a function.

Makes a new Assertion from a function.

Attributes

Source
Assertion.scala
def assertionRec[A, B](name: String)(assertion: Assertion[B])(get: A => Option[B]): Assertion[A]

Attributes

Source
Assertion.scala
def contains[A](element: A): Assertion[Iterable[A]]

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.

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.

Attributes

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

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

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

Attributes

Source
Assertion.scala

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

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

Attributes

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

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

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

Attributes

Source
Assertion.scala
def diesWithA[E : ClassTag]: Assertion[Exit[Any, Any]]

Makes a new assertion that requires an exit value to die with an instance of given type (or its subtype).

Makes a new assertion that requires an exit value to die with an instance of given type (or its subtype).

Attributes

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

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

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

Attributes

Source
Assertion.scala

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

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

Attributes

Source
Assertion.scala

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

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

Attributes

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

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.

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.

Attributes

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

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

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

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala
def failsWithA[E : ClassTag]: Assertion[Exit[Any, Any]]

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

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

Attributes

Source
Assertion.scala
def forall[A](assertion: Assertion[A]): Assertion[Iterable[A]]

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

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

Attributes

Source
Assertion.scala
def hasAt[A](pos: Int)(assertion: Assertion[A]): Assertion[Seq[A]]

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala
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))

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala
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.

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

Attributes

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

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

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

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala

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

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

Attributes

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

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

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

Attributes

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

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

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

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala

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.

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.

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala

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

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

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala

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

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

Attributes

Source
Assertion.scala

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

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

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala
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)

Attributes

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

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

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

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala
def isInterrupted: Assertion[Exit[Any, Any]]

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

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

Attributes

Source
Assertion.scala
def isJustInterrupted: Assertion[Exit[Any, Any]]

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

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

Attributes

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

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

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

Attributes

Source
Assertion.scala
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.

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

Attributes

Source
Assertion.scala
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.

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

Attributes

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

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

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

Attributes

Source
Assertion.scala
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.

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

Attributes

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

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

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

Attributes

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

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

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

Attributes

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

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

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

Attributes

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

Makes a new assertion that requires an Iterable is sorted.

Makes a new assertion that requires an Iterable is sorted.

Attributes

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

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

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

Attributes

Source
Assertion.scala
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))

Attributes

Source
Assertion.scala
def isSuccess[A](assertion: Assertion[A]): Assertion[Try[A]]

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

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

Attributes

Source
Assertion.scala
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).

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

Attributes

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

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

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

Attributes

Source
Assertion.scala

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

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

Attributes

Source
Assertion.scala
def nonNegative[A](implicit num: Numeric[A]): Assertion[A]

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

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

Attributes

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

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

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

Attributes

Source
Assertion.scala
def not[A](assertion: Assertion[A]): Assertion[A]

Makes a new assertion that negates the specified assertion.

Makes a new assertion that negates the specified assertion.

Attributes

Source
Assertion.scala
def startsWith[A](prefix: Seq[A]): Assertion[Seq[A]]

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

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

Attributes

Source
Assertion.scala

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

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

Attributes

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

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

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

Attributes

Source
Assertion.scala
def throws[A](assertion: Assertion[Throwable]): Assertion[A]

Makes a new assertion that requires the expression to throw.

Makes a new assertion that requires the expression to throw.

Attributes

Source
Assertion.scala
def throwsA[E : ClassTag]: Assertion[Any]

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

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

Attributes

Source
Assertion.scala

Inherited methods

final def equalTo[A](expected: A): Assertion[A]

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

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

Attributes

Inherited from:
AssertionVariants
Source
AssertionVariants.scala

Concrete fields

val anything: Assertion[Any]

Makes a new assertion that always succeeds.

Makes a new assertion that always succeeds.

Attributes

Source
Assertion.scala

Makes a new assertion that requires an Iterable is distinct.

Makes a new assertion that requires an Iterable is distinct.

Attributes

Source
Assertion.scala

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

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

Attributes

Source
Assertion.scala

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

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

Attributes

Source
Assertion.scala
val isFailure: Assertion[Try[Any]]

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

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

Attributes

Source
Assertion.scala

Makes a new assertion that requires a value be false.

Makes a new assertion that requires a value be false.

Attributes

Source
Assertion.scala
val isLeft: Assertion[Either[Any, Any]]

Makes a new assertion that requires an Either is Left.

Makes a new assertion that requires an Either is Left.

Attributes

Source
Assertion.scala

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

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

Attributes

Source
Assertion.scala

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

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

Attributes

Source
Assertion.scala
val isNone: Assertion[Option[Any]]

Makes a new assertion that requires a None value.

Makes a new assertion that requires a None value.

Attributes

Source
Assertion.scala
val isNull: Assertion[Any]

Makes a new assertion that requires a null value.

Makes a new assertion that requires a null value.

Attributes

Source
Assertion.scala
val isRight: Assertion[Either[Any, Any]]

Makes a new assertion that requires an Either is Right.

Makes a new assertion that requires an Either is Right.

Attributes

Source
Assertion.scala
val isSome: Assertion[Option[Any]]

Makes a new assertion that requires an Option is Some.

Makes a new assertion that requires an Option is Some.

Attributes

Source
Assertion.scala
val isSuccess: Assertion[Try[Any]]

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

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

Attributes

Source
Assertion.scala

Makes a new assertion that requires a value be true.

Makes a new assertion that requires a value be true.

Attributes

Source
Assertion.scala

Makes a new assertion that requires the value be unit.

Makes a new assertion that requires the value be unit.

Attributes

Source
Assertion.scala
val nothing: Assertion[Any]

Makes a new assertion that always fails.

Makes a new assertion that always fails.

Attributes

Source
Assertion.scala