org.scalamock.stubs

Members list

Type members

Classlikes

Attributes

Supertypes
class Object
trait Matchable
class Any
class StubbedIOMethod[A, R](delegate: StubbedMethod[A, R]) extends StubbedMethod[A, R]

Representation of stubbed method with arguments.

Representation of stubbed method with arguments.

CatsEffectStubs interface provides implicit conversion from selected method to StubbedMethodIO.

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

 val foo = stub[Foo]

Scala 3

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

Scala 2

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

Attributes

Supertypes
trait StubbedMethod[A, R]
trait Order
class Object
trait Matchable
class Any
class StubbedIOMethod0[R](delegate: StubbedMethod0[R]) extends StubbedMethod0[R]

Representation of stubbed method without arguments.

Representation of stubbed method without arguments.

CatsEffectStubs interface provides implicit conversion from selected method to StubbedMethodIO0.

 trait Foo:
   def foo00(): String
   def fooIO: IO[Int]

 val foo = stub[Foo]

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

Exclusively for IO - you can omit converting it to function

 val foo00Stubbed: StubbedMethod0[String] = () => foo.foo00()
 val fooIOStubbed: StubbedMethod0[IO[Int]] = foo.fooIO

Attributes

Supertypes
trait StubbedMethod0[R]
trait Order
class Object
trait Matchable
class Any