trait StubbedMethod0[R] extends Order
Representation of stubbed method without arguments.
Stubs interface provides implicit conversion from selected method to StubbedMethod0
You need to explicitly convert it to a function () => R
trait Foo: def foo0: Int def foo00(): String val foo = stub[Foo] val foo0Stubbed: StubbedMethod0[Int] = () => foo.foo0 val foo00Stubbed: StubbedMethod0[String] = () => foo.foo00()
- Alphabetic
- By Inheritance
- StubbedMethod0
- Order
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def asString: String
Returns string representation of method.
Returns string representation of method. Representation currently depends on scala version.
- Definition Classes
- Order
- abstract def isAfter(other: Order)(implicit callLog: CallLog): Boolean
Returns true if this method was called after other method.
Returns true if this method was called after other method.
Scala 3
foo.foo.returns(_ => 5) foo.fooBar.returns(_ => "bar") foo.foo(1) foo.fooBar(true, "bar") foo.foo.isAfter(foo.fooBar) // false
Scala 2
(foo.foo _).returns(_ => 5) (foo.fooBar _).returns(_ => "bar") foo.foo(1) foo.fooBar(true, "bar") (foo.foo _).isAfter(foo.fooBar _) // false
- Definition Classes
- Order
- abstract def isBefore(other: Order)(implicit callLog: CallLog): Boolean
Returns true if this method was called before other method.
Returns true if this method was called before other method.
Scala 3
foo.foo.returns(_ => 5) foo.fooBar.returns(_ => "bar") foo.foo(1) foo.fooBar(true, "bar") foo.foo.isBefore(foo.fooBar) // true
Scala 2
(foo.foo _).returns(_ => 5) (foo.fooBar _).returns(_ => "bar") foo.foo(1) foo.fooBar(true, "bar") (foo.foo _).isBefore(foo.fooBar _) // true
- Definition Classes
- Order
- abstract def returnsWith(value: => R): Unit
- abstract def times: Int
Allows to get number of times method was executed.
Allows to get number of times method was executed.
(() => foo.foo0).returns(5) foo.foo0 foo.foo0 (() => foo.foo0).times // 2
- abstract def returns(f: => R): Unit
Allows to set result for method without arguments.
Allows to set result for method without arguments.
(() => foo.foo00()).returns("abc") foo.foo00() // "abc"
- Annotations
- @deprecated
- Deprecated
Use
returnsWithinstead. Will be deleted in first release after 01.07.2025. This is needed to replace StubbedMethod0[R] with StubbedMethod[Unit, R]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
ScalaMock
This is the documentation for ScalaMock
For an overview, see org.scalamock.