Packages

package stubs

Linear Supertypes
AnyRef, Any

Type Members

  1. abstract type Stub[+T] <: T
  2. class StubbedZIOMethod[A, R] extends StubbedMethod[A, R]

    Representation of stubbed method with arguments.

    Representation of stubbed method with arguments.

    ZIOStubs interface provides implicit conversion from selected method to StubbedMethodZIO.

    trait Foo:
      def foo(x: Int): UIO[String]
      def bar(x: Int, y: String): IO[String, Int]
    
    val foo = stub[Foo]

    Scala 3

    val fooStubbed: StubbedMethod[Int, UIO[String]] = foo.foo
    val barStubbed: StubbedMethod[(Int, String), IO[String, Int]] = foo.bar

    Scala 2

    val fooStubbed: StubbedMethod[Int, UIO[String]] = foo.foo _
    val barStubbed: StubbedMethod[(Int, String), IO[String, Int]] = foo.bar _
  3. class StubbedZIOMethod0[R] extends StubbedMethod0[R]

    Representation of stubbed method without arguments.

    Representation of stubbed method without arguments.

    ZIOStubs interface provides implicit conversion from selected method to StubbedMethodZIO0.

    trait Foo:
      def foo00(): String
      def fooIO: IO[String, Int]
    
    val foo = stub[Foo]

    The default way of getting stub for such method - convert it to a function () => R.

    Exclusively for ZIO - you can omit converting it to function

    val foo00Stubbed: StubbedMethod0[String] = () => foo.foo00()
    val fooIOStubbed: StubbedMethod0[IO[String, Int]] = foo.fooIO
  4. trait ZIOStubs extends StubsBase

Inherited from AnyRef

Inherited from Any

Ungrouped