doc / ch.tutteli.atrium / IAtriumFactory / newCollectingPlant


abstract fun <T : Any> newCollectingPlant(subjectProvider: () -> T): CollectingAssertionPlant<T>
Deprecated: Use AssertImpl.coreFactory instead; will be removed with 1.0.0

Creates a CollectingAssertionPlant which is intended to be used as receiver object in lambdas to collect created Assertions inside the lambda.

Notice, that this AssertionPlant might not even provide a AssertionPlant.subject in which case it throws a PlantHasNoSubjectException if subject is accessed. Use newCheckingPlant instead if you want to know whether the assertions hold.


subjectProvider - The function which will either provide the subject for this plant or throw an PlantHasNoSubjectException in case it cannot be provided.

The newly created assertion plant.