Class

zio.test

TestLensAnyOps

Related Doc: package test

Permalink

implicit final class TestLensAnyOps[A] extends AnyVal

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TestLensAnyOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TestLensAnyOps(self: TestLens[A])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. def anything: TestLens[Boolean]

    Permalink

    Always returns true as long the chain of preceding transformations has succeeded.

    Always returns true as long the chain of preceding transformations has succeeded.

    val option: Either[Int, Option[String]] = Right(Some("Cool"))
    assertTrue(option.is(_.right.some.anything)) // returns true
    assertTrue(option.is(_.left.anything)) // will fail because of `.left`.
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def custom[B](customAssertion: CustomAssertion[A, B]): TestLens[B]

    Permalink

    Transforms a value with the given CustomAssertion

  7. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  8. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  9. def subtype[Subtype <: A]: TestLens[Subtype]

    Permalink

    Transforms a value of some type into the given Subtype if possible, otherwise fails.

    Transforms a value of some type into the given Subtype if possible, otherwise fails.

    sealed trait CustomError
    case class Explosion(blastRadius: Int) extends CustomError
    case class Melting(degrees: Double) extends CustomError
    case class Fulminating(wow: Boolean) extends CustomError
    
    val error: CustomError = Melting(100)
    assertTrue(option.is(_.subtype[Melting]).degrees > 10) // succeeds
    assertTrue(option.is(_.subtype[Explosion]).blastRadius == 12) // fails
  10. def toString(): String

    Permalink
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped