mirror of
https://github.com/jlengrand/atrium.git
synced 2026-03-10 08:01:19 +00:00
delete ExperimentalExpectConfig and co.
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user