its

infix fun <T, R> Expect<T>.its(extractor: T.() -> R): FeatureExpect<T, R>(source)

Extracts a feature out of the current subject of this expectation with the help of the given extractor, creates a new Expect for it and returns it so that subsequent calls are based on the feature.

Return

The newly created Expect for the extracted feature.

Since

0.16.0


infix fun <T, R> Expect<T>.its(extractorWithCreator: ExtractorWithCreator<T, R>): Expect<T>(source)

Extracts a feature out of the current subject of this expectation with the help of the given extractorWithCreator.extractor, creates a new Expect for it, applies an expectation-group based on the given extractorWithCreator.assertionCreator for the feature and returns the initial Expect with the current subject.

Return

an Expect for the subject of this expectation.

Since

0.16.0


val <T> Expect<T>.its: Expect<T>(source)

Inline property referring actually to this and allows writing infix assertions within an expectation-group

For instance, instead of:

expect {
...
}.toThrow<...>{
this messageToContain "oho"
}

You can write

expect {
...
}.toThrow<...>{
its messageToContain "oho"
}

Return

this

Since

0.12.0