org.scalamock.stubs.StubbedIOMethod0
class StubbedIOMethod0[R](delegate: StubbedMethod0[R]) extends StubbedMethod0[R]
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
-
Graph
-
-
Supertypes
-
trait StubbedMethod0[R]
trait Order
class Object
trait Matchable
class Any
Members list
Returns string representation of method. Representation currently depends on scala version.
Returns string representation of method. Representation currently depends on scala version.
Attributes
Returns true if this method was called after other method.
Returns true if this method was called after other method.
Attributes
Returns true if this method was called before other method.
Returns true if this method was called before other method.
Attributes
Allows to set result for method without arguments.
Allows to set result for method without arguments.
(() => foo.foo00()).returns("result")
foo.fooIO.returns(IO(1))
Attributes
Allows to set result for method without arguments. Returns IO.
Allows to set result for method without arguments. Returns IO.
for {
_ <- (() => foo.foo00()).returnsIO("result")
_ <- foo.fooIO.returnsIO(IO(1))
} yield ()
Attributes
Allows to get number of times method was executed.
Allows to get number of times method was executed.
for {
_ <- foo.fooIO.returnsIO(IO(1))
_ <- foo.fooIO
_ <- foo.fooIO
} yield foo.fooIO.times == 2 // true
Attributes
Allows to get number of times method was executed. Returns IO.
Allows to get number of times method was executed. Returns IO.
for {
_ <- foo.fooIO.returnsIO(IO(1))
_ <- foo.fooIO
_ <- foo.fooIO
fooIOTimes <- foo.fooIO.timesIO
} yield fooIOTimes == 2 // true
Attributes
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
-
Returns
-
a string representation of the object.
-
Definition Classes
-
Any