realInstance

inline fun <T> MockspressoBuilder.realInstance(qualifier: Annotation? = null, noinline init: T.() -> Unit = { }): MockspressoBuilder

Register a request to create a real object of type T bound in the mockspresso graph with a dependencyKey made from type T and qualifier.

The supplied init lambda will be called when the real object is created.


inline fun <T> MockspressoProperties.realInstance(qualifier: Annotation? = null, noinline init: T.() -> Unit = { }): Lazy<T>

Register a request to create a real object of type T bound in the mockspresso graph with a dependencyKey made from type T and qualifier.

The supplied init lambda will be called when the real object is created.

Returns a Lazy of the resulting real object IMPORTANT: Reading the value from the returned lazy will cause the underlying MockspressoInstance to be ensured if it hasn't been already.