CatsEffectStubs
Attributes
- Experimental
- true
- Graph
-
- Supertypes
-
trait Stubsclass Objecttrait Matchableclass Any
Members list
Value members
Inherited methods
Resets all recorded stub functions and arguments. This is useful if you want to create your stub once per suite. Note that in such case test cases should run sequentially
Resets all recorded stub functions and arguments. This is useful if you want to create your stub once per suite. Note that in such case test cases should run sequentially
Attributes
- Inherited from:
- Stubs
Generates an object of type T with possibility to record methods arguments and set-up method results
Generates an object of type T with possibility to record methods arguments and set-up method results
Attributes
- Inherited from:
- Stubs
Givens
Givens
Inherited givens
Collects all generated stubs
Collects all generated stubs
Attributes
- Inherited from:
- Stubs
Extensions
Extensions
Inherited extensions
Allows to get caught method arguments. For multiple arguments - returns them tupled. One list item per call.
Allows to get caught method arguments. For multiple arguments - returns them tupled. One list item per call.
trait Foo:
def foo1(x: Int): Int
def foo2(x: Int, y: Int): Int
val foo = stub[Foo]
foo.foo1.returns(_ => 1)
foo.foo2.returns(_ => 1)
foo.foo1(2)
foo.foo1(2)
foo.foo2(0, 0)
foo.foo2(1, 1)
foo.foo1.calls // List(2, 2)
foo.foo2.calls // List((0, 0), (1, 1))
Attributes
- Inherited from:
- Stubs
Attributes
- Inherited from:
- Stubs
Attributes
- Inherited from:
- Stubs
Allows to set result for method with arguments.
Allows to set result for method with arguments.
trait Foo:
def foo1(x: Int): Int
def foo2(x: Int, y: Int): Int
val foo = stub[Foo]
foo.foo1.returns:
case 1 => 2
case 2 => 5
case _ => 0
foo.foo2.returns:
case (0, 0) => 1
case _ => 0
foo.foo1(2) // 5
foo.foo2(0, 0) // 1
Attributes
- Inherited from:
- Stubs
Allows to set result for method without arguments.
Allows to set result for method without arguments.
trait Foo:
def foo0: Int
val foo = stub[Foo]
foo.foo0.returns(5)
foo.foo0 // 5
Attributes
- Inherited from:
- Stubs
Allows to get number of times method was executed with specified arguments. Multiple arguments should be provided as tuple.
Allows to get number of times method was executed with specified arguments. Multiple arguments should be provided as tuple.
trait Foo:
def foo1(x: Int): Int
def foo2(x: Int, y: Int): Int
val foo = stub[Foo]
foo.foo1.returns(_ => 1)
foo.foo2.returns(_ => 2)
foo.foo1(3)
foo.foo1(3)
foo.foo2(1, 1)
foo.foo1.times(1) // 0
foo.foo1.times(3) // 2
foo.foo2.times((1, 1)) // 1
Attributes
- Inherited from:
- Stubs
Allows to get number of times method was executed.
Allows to get number of times method was executed.
trait Foo:
def foo1(x: Int): Int
val foo = stub[Foo]
foo.foo1.returns(_ => 1)
foo.foo1(2)
foo.foo1(3)
foo.foo1.times // 2
Attributes
- Inherited from:
- Stubs