-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚧 Adopt the ‘to+infinitive’ Convention #714
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package ch.tutteli.atrium.api.fluent.en_GB | ||
|
||
import ch.tutteli.atrium.creating.Expect | ||
import ch.tutteli.atrium.logic.creating.typeutils.IterableLike | ||
import ch.tutteli.atrium.logic.* | ||
import ch.tutteli.atrium.logic.creating.typeutils.IterableLike | ||
import ch.tutteli.atrium.logic.utils.iterableLikeToIterable | ||
import ch.tutteli.atrium.reporting.Reporter | ||
import ch.tutteli.kbox.glue | ||
|
@@ -30,22 +30,56 @@ fun <T> Expect<T>.notToBe(expected: T): Expect<T> = _logicAppend { notToBe(expec | |
/** | ||
* Expects that the subject of the assertion is the same instance as [expected]. | ||
* | ||
* Deprecated as atrium moves to a consistent ‘to + infinitive’ naming convention. Use [toBeTheSameAs] instead. | ||
* This function will be removed in version 1.0.0. See | ||
* [atrium-roadmap#93](https://github.com/robstoll/atrium-roadmap/issues/93) for details and to give feedback. | ||
* | ||
* @return An [Expect] for the current subject of the assertion. | ||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. | ||
*/ | ||
@Deprecated( | ||
"Replaced by toBeTheSameAs. Will be removed with version 1.0.0", | ||
robstoll marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ReplaceWith("this.toBeTheSameAs<T>(expected)") | ||
) // TODO remove with 1.0.0 | ||
fun <T> Expect<T>.isSameAs(expected: T): Expect<T> = toBeTheSameAs(expected) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jGleitz IMO we should provide once again a script in order that users have a smooth migration experience. Do you see the draft release here? https://github.com/robstoll/atrium/releases/tag/untagged-c4eefbbdd8d22b72bc20 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No, I get a 404 for that link. Writing a script feels like duplicating what the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not that I know of, you were able to choose There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. I’ll prioritize work on my open pull requests, but will help on the script if I find the time. |
||
|
||
/** | ||
* Expects that the subject of `this` assertion is the same instance as [expected]. | ||
robstoll marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isSameAs | ||
* @return an [Expect] for the current subject of `this` assertion. | ||
robstoll marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* @throws AssertionError if the subject of `this` assertion is not the same instance as [expected]. | ||
robstoll marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* @since 0.16.0 | ||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.toBeTheSameAs | ||
*/ | ||
fun <T> Expect<T>.isSameAs(expected: T): Expect<T> = _logicAppend { isSameAs(expected) } | ||
fun <T> Expect<T>.toBeTheSameAs(expected: T): Expect<T> = _logicAppend { toBeTheSameAs(expected) } | ||
|
||
/** | ||
* Expects that the subject of the assertion is not the same instance as [expected]. | ||
* | ||
* Deprecated as atrium moves to a consistent ‘to + infinitive’ naming convention. Use [notToBeTheSameAs] instead. | ||
* This function will be removed in version 1.0.0. See | ||
* [atrium-roadmap#93](https://github.com/robstoll/atrium-roadmap/issues/93) for details and to give feedback. | ||
* | ||
* @return An [Expect] for the current subject of the assertion. | ||
* @throws AssertionError Might throw an [AssertionError] if the assertion made is not correct. | ||
*/ | ||
@Deprecated( | ||
"Replaced by notToBeTheSameAs. Will be removed with version 1.0.0", | ||
ReplaceWith("this.notToBeTheSameAs<T>(expected)") | ||
) // TODO remove with 1.0.0 | ||
fun <T> Expect<T>.isNotSameAs(expected: T): Expect<T> = notToBeTheSameAs(expected) | ||
|
||
/** | ||
* Expects that the subject of `this` assertion is not the same instance as [expected]. | ||
* | ||
* @return an [Expect] for the current subject of `this` assertion. | ||
* @throws AssertionError if the subject of `this` assertion is the same instance as [expected]. | ||
jGleitz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* | ||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.isNotSameAs | ||
* @since 0.16.0 | ||
* @sample ch.tutteli.atrium.api.fluent.en_GB.samples.AnyAssertionSamples.notToBeTheSameAs | ||
*/ | ||
fun <T> Expect<T>.isNotSameAs(expected: T): Expect<T> = _logicAppend { isNotSameAs(expected) } | ||
fun <T> Expect<T>.notToBeTheSameAs(expected: T): Expect<T> = _logicAppend { notToBeTheSameAs(expected) } | ||
|
||
/** | ||
* Expects that the subject of the assertion is either `null` in case [assertionCreatorOrNull] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Detail but more aligned with the readme: