delete ExperimentalExpectConfig and co.

This commit is contained in:
Robert Stoll
2020-11-13 21:41:04 +01:00
parent 5e04d636a8
commit 5f2d97c46e
5 changed files with 2 additions and 77 deletions

View File

@@ -60,7 +60,7 @@ fun <T> RootExpect<T>.withOptions(configuration: ExpectBuilder.OptionsChooser<T>
*/
@ExperimentalWithOptions
@Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */)
@UseExperimental(ExperimentalExpectConfig::class, ExperimentalNewExpectTypes::class)
@UseExperimental(ExperimentalNewExpectTypes::class)
fun <T> RootExpect<T>.withOptions(options: ExpectOptions<T>): Expect<T> =
RootExpect(this, options.toRootExpectOptions())

View File

@@ -52,7 +52,7 @@ infix fun <T> RootExpect<T>.withOptions(configuration: ExpectBuilder.OptionsChoo
*/
@ExperimentalWithOptions
@Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */)
@UseExperimental(ExperimentalExpectConfig::class, ExperimentalNewExpectTypes::class)
@UseExperimental(ExperimentalNewExpectTypes::class)
infix fun <T> RootExpect<T>.withOptions(options: ExpectOptions<T>): Expect<T> =
RootExpect(this, options.toRootExpectOptions())

View File

@@ -212,33 +212,6 @@ interface CoreFactoryCommon {
assertionCheckerDecorator: ReportingAssertionContainer.AssertionCheckerDecorator<T>
): ReportingAssertionContainer<T>
@Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */)
@UseExperimental(ExperimentalExpectConfig::class, ExperimentalNewExpectTypes::class)
@Deprecated(
"Use FeatureExpect instead; will be removed with 1.0.0", ReplaceWith(
"FeatureExpect(\n" +
" previousExpect,\n" +
" maybeSubject,\n" +
" featureConfig.description,\n" +
" assertions,\n" +
" FeatureExpectOptions(representationInsteadOfFeature = { featureConfig.representation ?: Text.NULL })\n" +
" )"
)
)
fun <T, R> newFeatureExpect(
previousExpect: Expect<T>,
maybeSubject: Option<R>,
featureConfig: FeatureExpectConfig,
assertions: List<Assertion>
): FeatureExpect<T, R> = FeatureExpect(
previousExpect,
maybeSubject,
featureConfig.description,
assertions,
FeatureExpectOptions(representationInsteadOfFeature = { featureConfig.representation ?: Text.NULL })
)
/**
* Creates a [ReportingAssertionPlant] which checks and reports added [Assertion]s.
*

View File

@@ -1,46 +0,0 @@
//TODO remove with 0.14.0
@file:Suppress("DEPRECATION")
package ch.tutteli.atrium.creating
import ch.tutteli.atrium.reporting.translating.Translatable
@Suppress("DEPRECATION" /* RequiresOptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */)
@Experimental
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.CLASS)
@Deprecated("will be removed with 0.14.0")
annotation class ExperimentalExpectConfig
@ExperimentalExpectConfig
@Deprecated("will be removed with 0.14.0")
interface BaseExpectConfig {
val description: Translatable
val representation: Any?
}
@ExperimentalExpectConfig
@Deprecated("will be removed with 0.14.0")
interface RootExpectConfig : BaseExpectConfig {
companion object {
fun create(description: Translatable, representation: Any?): RootExpectConfig =
ExpectConfig(description, representation)
}
}
@ExperimentalExpectConfig
@Deprecated("will be removed with 0.14.0")
interface FeatureExpectConfig : BaseExpectConfig {
companion object {
fun create(description: Translatable, representation: Any?): FeatureExpectConfig =
ExpectConfig(description, representation)
}
}
@ExperimentalExpectConfig
@Deprecated("will be removed with 0.14.0")
private data class ExpectConfig(
override val description: Translatable,
override val representation: Any?
) : FeatureExpectConfig,
RootExpectConfig

View File

@@ -179,8 +179,6 @@ internal class FeatureExpectImpl<T, R>(
addAssertions(assertions)
}
@Suppress("DEPRECATION" /* OptIn is only available since 1.3.70 which we cannot use if we want to support 1.2 */)
@UseExperimental(ExperimentalExpectConfig::class)
override fun addAssertion(assertion: Assertion): Expect<R> {
assertions.add(assertion)
//Would be nice if we don't have to add it immediately to the previousExpect but only: