Releases: robstoll/atrium
isEqualComparingTo, isNoneOf and string based LocalDateTime
Table of Content
- New Features
- Fixes
- Improvements
- Breaking Changes
- Deprecation
- Migrating deprecated functionality
- Sponsors
New Features
All APIs
- #460 add Iterator.hasNext/hasNotNext => thanks to @mspear for the implementation
- #484 introduce Comparable.isEqualComparingTo => thanks to @jaibhavaya for the implementation
- #180 Any.isNoneOf/isNotIn=> thanks to @anesabml for the implementation
- #479 Allow that Sequence and Array can be passed to elementsOf => thanks to @anesabml for the implementation
- #481 accept date and time as string in ISO 8601 format for ChronoLocalDateTime => thanks to @rkiselev for the implementation of the fluent API
api-fluent-en_GB
- no fluent only additions this time
api-infx-en_GB
- Path.hasSameTextualContentAs added to infix API as well => thanks to @z13z for most of the work
Domain / Core
- we transition away from atrium-domain-... to atrium-logic, getting rid of ServiceLoader and other changes. Some parts of domain where already deprecated. Stay tuned, documentation will be updated with 0.14.0
Fixes
- #515 Path assertions use wrong description
Improvements
- #234 remove limit of stacktrace
- #483 adjust reporting for isLess/GreaterThanOrEqual => thanks to @z13z for the implementation
- #477 deprecate defaultTranslationOf(IgnoringCase) => thanks to @z13z for the implementation
- #337 filter jasmine out of error-stacks => thanks to @z13z for part of the work
Breaking Changes
Planned (previously deprecated or announced)
- none this time
Unplanned
- we are treating Translatable now special in the ObjectFormatter which does not make it necessary to wrap it into a RawString. This is a breaking change depending on how you have defined your Translatable. In case it was an Enum and you formatted it without wrapping it into a RawString, then it is now translated instead. I assume this should never be the case, so this breaking change is only hypothetical.
- removed
ch.tutteli.atrium.assertions.builders.Explanatory.ExplanationOption#withExplanation(ch.tutteli.atrium.reporting.translating.Translatable)
because Translatables are now treated as Text in any case -- this is a binary backward compatibility break, it should suffice to re-compile. - removed
ch.tutteli.atrium.domain.builders.creating.changers.FeatureExtractorBuilder.RepresentationInCaseOfFailureStep#withRepresentationForFailure(ch.tutteli.atrium.reporting.translating.Translatable)
for the same reason - removed
previousExpect
andgetAssertions()
from FeatureExpect => let me know in case you used it - removed experimental
config
from RootExpect and FeatureExpect
Deprecation
- Feature/RootExpectConfig; ; will be removed with 1.0.0
- CoreFactory... (will all be removed with 1.0.0)
- newDelegatingReportingAssertionContainer
- newFeatureExpect
- newReportingAssertionContainer
- newCollectingAssertionContainer
- RawString; will be removed with 1.0.0 -> use Text
- StringBasedRawString; will be removed with 1.0.0 -> use Text
- TranslatableBasedRawString; will be removed with 1.0.0 -> no longer required, use Translatable directly
- ReportingAssertionContainer including factory methods; will be removed with 1.0.0 -> use RootExpect, FeatureExpect or DelegatingExpect instead
- AssertionChecker and all its variants including factory methods; will be removed with 1.0.0 -> use RootExpect, FeatureExpect or DelegatingExpect instead
- ch.tutteli.atrium.translations.ErrorMessages -> use ch.tutteli.atrium.creating.ErrorMessages instead
- ch.tutteli.atrium.domain.robstoll.lib.creating.throwable.thrown.creators.ThrowableThrownFailureHandler -> use ch.tutteli.atrium.logic.impl.creating.changers.ThrowableThrownFailureHandler instead
- the modules atrium-domain-robstoll and atrium-domain-robstoll-lib -> use atrium-logic instead
- all assertion interfaces in domain-api except for CharSequence/IterableAssertions, they will be deprecated in 0.14.0
- correspondingly all builders in domain-builders, impl classes in domain-robstoll and impl functions in domain-robstoll-lib (basically almost everything in domain-robstoll and domain-robstoll-lib is deprecated -> use atrium-logic instead)
Breaking Changes with 0.14.0
- we are going to replace IterableContains with IterableLikeContains, this is a binary backward compatibility break. Source compatibility should still hold. IterableLikeContains will path the way to use it with Array types.
- we are going to replace CharSequenceContains from domain with CharSequence from logic, this is a binary backward compatibility break. Source compatibility should still hold.
- the new module atrium-logic introduced with this version is not stable yet, we most likely break things with 0.14.0. Planned is to replace CollectionAssertions with CollectionLikeAssertions.
Breaking Changes with 1.0.0
See atrium-roadmap -> Milestone 1.0.0
Migrating deprecated functionality
There a few deprecations in this version (see above) --
use the ReplaceWith
provided in the @Depreacted
annotations.
Please have a look at the older release-notes in case you don't migrate from 0.12.0
Sponsors
We would like to thank Tegonal GmbH for sponsoring Support and PR-Review time as well as the extra hours to finish the open PRs which should made it into v0.13.0.
Are you are using Atrium at work?
Please consider to support the project as well by:
- sponsoring robstoll (Author and main contributor)
- report bugs
- share your assertion functions with others
new infix API based on Expect instead of Assert
API Maturity: Stable
Implementation Maturity: Almost Stable
There won't be any breaking changes in the API (assertion functions/builders) until v1.0.0 besides parameter name renaming and experimental features. But we want to progress as well and deprecate functionality in each version (e.g quite a lot with 0.7.0; please replace deprecated functionality until v1.0.0 where we will remove it).
However, we do not provide yet a stable API for the domain and core modules of Atrium -- it is almost stable, but there might be slight breaking changes which we want to introduce before v1.0.0. That is also the reason why we do not have yet established backward compatibility tests for domain/core. This might affect you if you write your own assertion functions. And it also affects you if you provide your own implementation for parts of Atrium.
Table of Content
New Features
api-fluent-en_GB
new api-infix-en_GB
Thanks to the following contributors to support the migration from cc-infix-en_GB to infix-en_GB:
- #227 collectionAssertions => thanks to @ratkayandras
- #231 pairAssertions => thanks to @dexpota
- #228 listAssertions => thanks to @sanatik
- #232 sequenceAssertions => thanks to @ivanmiklec
- #229 mapAssertions => thanks to @jlundhol
- #230 mapEntryAssertions => thanks to @johnGachihi
- #226 arrayAssertions => thanks to @isfedorov
- #233 bigDecimalAssertions => thanks to @isfedorov
- #236 create bundles for the new infix API => thanks to @isfedorov
- #316 fileAssertions => thanks to @jGleitz
- #317 localDateAssertions => thanks to @jGleitz
- #318 localDateTimeAssertions => thanks to @jGleitz
- #319 zonedDateTimeAssertions=> thanks to @tfesenko
- #313 chronoLocalDateAssertions => thanks to @ivanmiklec
- #314 chronoLocalDateTimeAssertions => thanks to @isfedorov
- #315 chronoZonedDateTimeAssertions => thanks to @tfesenko
- #388 optionalAssertions => thanks to @isfedorov
kotlin 1.3 extensions
- #389 resultAssertions => thanks to @ivanmiklec
Domain / Core
- none this time
Fixes
- none this time
Improvements
- #235 setup code coverage for windows=> thanks to @ivanmiklec
- #245 Build samples as composite build => thanks to @assaflei
#/167 compile android class files into dex bytecode => thanks to @assaflei - #493 merge jdk8 extension into jvm module => thanks to @assaflei
- #470 create maven sample project => thanks to @binkley
- #466 fail if a TranslatableWithArgs has not exact arguments => thanks to @tkech17
- #495 cache gradle and dependencies in github actions => thanks to @assaflei
- #506 remove android jars -> they are no longer required => thanks to @ultraon for checking if the module-info.class bug was really resolved in d8
Breaking Changes
Planned (previously deprecated or announced)
- none this time (yet we no longer publish a dedicated
-android
jar you can use the regular jvm artifact instead)
Unplanned
- none this time
Deprecation
The following was deprecated and will be removed with 1.0.0:
- API cc-infix-en_GB => use infix-en_GB, fluent-en_GB respectively => a big thank you to @Miftahunajat for the many ReplaceWith he placed all over api-cc-infix to ease the migration 👍
- the jdk8 extension was merged into the normal module => search
import ch.tutteli.atrium.api.fluent.en_GB.jdk8
replace withimport ch.tutteli.atrium.api.fluent.en_GB
Breaking Changes with 1.0.0
See atrium-roadmap -> Milestone 1.0.0
Migrating deprecated functionality
API fluent
There aren't any deprecations in api-fluent-en_GB in this version and thus also no migration required if you update from 0.9.x, 0.10.0 or 0.11.0
In case you used the jdk8 extension: it was merged into the main artifact:
- perform a search for
import ch.tutteli.atrium.api.fluent.en_GB.jdk8
and replace withimport ch.tutteli.atrium.api.fluent.en_GB
- remove the corresponding dependency
API infix
You should migrate from api-cc-infix-en_GB to the new api-infix-en_GB (api-cc-infix-en_GB will be removed with 1.0.0)
In case you migrate from a version < 0.7.0 to this version, then please have a look at the migration guide given in the Release notes of v0.7.0 and v0.8.0 first.
Otherwise you can use the suggested replacements (ALT + Enter -> Replace with ...) or the search/replace patterns shown below (recommended, since faster).
Notice, that you don't have to migrate everything at once where asExpect
and asAssert
allow to switch between the old Assert
and the new Expect
world.
Ping us in the Atrium slack channel if you need help.
The following command is carrying out the points 1 to 14 as described below. The script for 15a or 15b follows afterwards (don't forget to do the manual points 16, 17, ...), run it from the root of your project, no guarantees that your system is capable of carrying it out. If not, you can use the manual steps described below.
find ./ -path "*/test/*" -name "*.kt" | xargs perl -0777 -i \
-pe 's/AssertImpl([\n\r\s]*)\.changeSubject\(([^\)\n]+)\)[\n\r\s]*\{[\n\r\s]*subject/ExpectImpl$1.changeSubject\($2\)$1.unreported \{ it/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.changeSubject\(([^\)]+)\)/ExpectImpl$1.changeSubject\($2\).unreported/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.createDescriptive\(([^,\n]+,[^\)]+\)[\n\r\s]*\{[\n\r\s]*)plant.subject/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.createDescriptive\(([^,\n]+,[^\)]+\)[\n\r\s]*\{[\n\r\s]*)plant.subject/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.descriptive([\n\r\s]*).withTest(\(?[\n\r\s]*)\{([\n\r\s]*)plant.subject/AssertImpl$1.builder$2.descriptive$3.withTest\(plant\)$4\{$5it/g;' \
-pe 's/AssertImpl([\n\r\s]*)\.builder([\n\r\s]*)\.descriptive([\n\r\s]*).withTest(\(?[\n\r\s]*)\{([\n\r\s]*)subject/AssertImpl$1.builder$2.descriptive$3.withTest\(this\)$4\{$5it/g;' \
-pe 's/(\.| )((?:toThrow|isA)<.*>)\s*\{\s*\}/$1$2()/g;' \
-pe 's/notToBeNull\s*\{\s*\}/notToBe null/g;' \
-pe 's/fun <T\s*:\s*Any> ([^\(]+)\(subject:\s*T\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlant\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[\n\r\s]*reporter\)/fun <T> $1\(subject: T\): Expect<T> = \n ExpectBuilder.forSubject\(subject\)\n .withVerb\($2\)\n .withoutOptions\(\)\n .build\(\)/g;' \
-pe 's/fun <T\s*:\s*Any> ([^\(]+)\(subject:\s*T\s*,[\n\r\s]*assertionCreator: Assert<T>.\(\)\s*->\s*Unit\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlantAndAddAssertionsCreatedBy\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[\n\r\s]*reporter,[\n\r\s]*assertionCreator\)/fun <T> $1\(subject: T, assertionCreator: Expect<T>.\(\) -> Unit\): Expect<T> = \n $1(subject).addAssertionsCreatedBy(assertionCreator)/g;' \
-pe 's/(?:internal )?fun <T(?:\s*:\s*Any\?)?> ([^\(]+)\(subject:\s*T\)[\n\r\s]*=[\n\r\s]*AssertImpl[\n\r\s]*\.coreFactory[\n\r\s]*\.newReportingPlantNullable\(([^,]+),[\n\r\s]*\{\s*subject\s*\}[\n\r\s]*,[^\)]+\)//g;' \
-pe 's/import ch.tutteli.atrium.verbs\.(expect|assert|assertThat)/import ch.tutteli.atrium.api.verbs.$1/g;' \
-pe 's/AssertImpl/ExpectImpl/g;' \
-pe 's/fun Assert(?:ionPlant(?:Nullable)?)?<(.*)>\./fun <T: $1> Expect<T>\./g;' \
-pe 's/Assert(ionPlant(Nullable)?)?</Expect</g;' \
-pe 's/import ch\.tutteli\.atrium\.creating\.Assert(ionPlant(Nullable)?)?/import ch.tutteli.atrium.creating.Expect/g;' \
-pe 's/import ch.tutteli\.atrium\.api\.cc\.infix\.en_GB/import ch.tutteli.atrium.api.infix.en_GB/g;' \
-pe 's/is(Less|Greater)OrEquals/is$1ThanOrEqual/g;' \
-pe 's/\.asIterable\(\)/ asList o/g;' \
-pe 's/asIterable(\s*\{)/asList$1/g;' \
-pe 's/\.asEntries\(\)/ asEntries o/g;' \
-pe 's/ o / it /g;' \
-pe 's/get\s*Index\(([^\)]+)\)\s*assertIt\s*\{([^\}]+)\}/get index($1) {$2}/g;' \
-pe 's/import ch.tutteli.atrium.api.infix.en_GB.Index/import ch.tutteli.atrium.api.infix.en_GB.index/g;' \
-pe 's/getExisting\s*Key\(([^\)]+)\)\s*assertIt\s*\{([^\}]+)\}/getExisting key($1) {$2}/g;' \
-pe 's/import ch.tutteli.atrium.api.infix.en_GB.Key/import ch.tutteli.atrium.api.infix.en_GB.key/g;'
In case you use Kotlin 1.4 or have enabled the new type inference, then you can use the following script to carry out point 13a:
find ./ -path "*/test/*" -name "*.kt" | xargs perl -0777 -i \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)/$1its feature of(\{ f(it::$2) \})$3/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)(\s*\{)/feature of(\{ f(it::$1) \})$2/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)/$1its feature \{ f(it::$2) \}/g;' \
-pe 's/(?:property|returnValueOf|rueckgabewertVon)\((?:[\n\r\s]*)subject::([^\)]+)\)/feature \{ f(it::$1) \}/g;' \
-pe 's/((?:[\n\r]+|\{)\s*)(?:property|returnValueOf|rueckgabewertVon)\(([A-Z][^:]+)::([^\)]+)\)(\s*\{)/$1its feature of($2::$3)$4/g;' \
-pe 's/(?:property|returnValue...
fix reporting issue when using Spek JVM
See #485 for more details. All other features introduce in v0.11.0 are shown in release notes of v0.11.0
additional shortcuts for elementsOf
API Maturity: Stable
Implementation Maturity: Almost Stable
There won't be any breaking changes in the API (assertion functions/builders) until v1.0.0 besides parameter name renaming and experimental features. But we want to progress as well and deprecate functionality in each version (e.g quite a lot with 0.7.0 and with 0.9.0; please replace deprecated functionality until v1.0.0 where we will remove it).
However, we do not provide yet a stable API for the domain and core modules of Atrium -- it is almost stable, but there might be slight breaking changes which we want to introduce before v1.0.0. That is also the reason why we do not have yet established backward compatibility tests for domain/core. This might affect you if you write your own assertion functions. And it also affects you if you provide your own implementation for parts of Atrium.
Table of Content
New Features
API fluent-en_GB
- #131 shortcut Iterable.containsExactlyElementsOf => thanks to @tkech17
- #425 shortcut Iterable.containsElementsOf => thanks to @tkech17
- #422 add elementsOf to contains.ignoreCase => thanks to @Miftahunajat
Domain / Core
- none this time
Fixes
- none this time
Improvements
- #339 Avoid Duplicated Messages
- #116 Migrate Spek1 specs to Spek2 => thanks to @assaflei
- #416 move non-jvm specific specs to common => thanks to @assaflei
Breaking Changes
Planned (previously deprecated or announced)
- none this time
Unplanned
- none this time
Deprecation
- none this time
Breaking Changes with 1.0.0
See atrium-roadmap -> Milestone 1.0.0
Migrating deprecated functionality
There aren't any deprecations in this version and thus also no migration required if you update from 0.9.x or 0.10.0.
In case you migrate from 0.8.0 to this version, have a look at the migration guide given in the release notes of v0.9.0
shortcuts for Throwable.cause and Path.resolve
API Maturity: Stable
Implementation Maturity: Almost Stable
There won't be any breaking changes in the API (assertion functions/builders) until v1.0.0 besides parameter name renaming and experimental features. But we want to progress as well and deprecate functionality in each version (e.g quite a lot with 0.7.0; please replace deprecated functionality until v1.0.0 where we will remove it).
However, we do not provide yet a stable API for the domain and core modules of Atrium -- it is almost stable, but there might be slight breaking changes which we want to introduce before v1.0.0. That is also the reason why we do not have yet established backward compatibility tests for domain/core. This might affect you if you write your own assertion functions. And it also affects you if you provide your own implementation for parts of Atrium.
Table of Content
New Features
API fluent-en_GB
jdk8 extensions
Domain / Core
- none this time
Fixes
- none this time
Improvements
- component diagram by @tfesenko in CONTRIBUTING.md
Breaking Changes
Planned (previously deprecated or announced)
- none this time
Unplanned
- none this time
Deprecation
- none this time
Breaking Changes with 1.0.0
See atrium-roadmap -> Milestone 1.0.0
Migrating deprecated functionality
There aren't any deprecations in this version and thus also no migration required if you update from 0.9.0.
In case you migrate from 0.8.0 to this version, have a look at the migration guide given in the release notes of v0.9.0
withOptions and withRepresentation as experimental feature
Fixes
it was planned that withOptions
ships with 0.9.0 (see #153). However, this was done only for the assertion verb which is used internally in Atrium but was not revealed for the predefined assertion verbs, hence this patch-version (thanks to @matejdro for the report - #362)
Most users won't use withOptions
and thus we are going to present only withRepresentation
for now (introduced in 0.9.2 #365).
❗❗Note though that withOptions
and withRepresentation
are both experimental and might be changed in a future version without previous notice nor migration path.
withRepresentation
can be used as follows :
expect(listOf(1,2,2,3 /* imagine a lot more numbers */))
.withRepresentation("xy numbers")
.all { isLessThan(10) }
The error report looks then as follows in case of a failure:
expected that subject: xy numbers
◆ all entries:
» is less than: 10 (kotlin.Int <1234789>)
❗❗ following entries were mismatched:
⚬ index 101: 12 (kotlin.Int <8933389>)
⚬ index 223: 10 (kotlin.Int <4523459>)
To use it, you have to add the following annotation to your test method/class @UseExperimental(ExperimentalWithOptions::class)
Further Improvements
all other features as well a migration guide is given in the release notes of v0.9.0
fix for gradle 6 jdk8 issues
all other features as well a migration guide is given in the release notes of v0.9.0
Expect as replacement for Assert and jdk8/kotlin 1.3 specific assertions
API Maturity: Stable
Implementation Maturity: Almost Stable
There won't be any breaking changes in the API (assertion functions/builders) until v1.0.0 besides parameter name renaming and experimental features. But we want to progress as well and deprecate functionality in each version (e.g quite a lot with 0.7.0; please replace deprecated functionality until v1.0.0 where we will remove it).
However, we do not provide yet a stable API for the domain and core modules of Atrium -- it is almost stable, but there might be slight breaking changes which we want to introduce before v1.0.0. That is also the reason why we do not have yet established backward compatibility tests for domain/core. This might affect you if you write your own assertion functions. And it also affects you if you provide your own implementation for parts of Atrium.
Table of Content
New Features
new API fluent-en_GB
- #26 Introduced
Expect<T>
as replacement forAssert<out T>
=> things likeexpect(1).toBe("not an int")
result now in a compile error - #66 allow to pass single Char to starts(Not)With/ends(Not)With => thanks to @kssc0112 for the implementation
- #128 Iterable.contains.inOrder.only.elementsOf => thanks to @npswedberg for the implementation
- #129 Iterable.contains.inAnyOrder.elementsOf => thanks to @sanatik for the implementation
- #127 Iterable.contains.inAnyOrder.only.elementsOf => thanks to @johnGachihi for the implementation
- #158 Iterable.hasNext/hasNotNext => thanks to @sanatik for the implementation
- #163 shortcut for Iterable.min() => thanks to @piyushmor for the implementation
- #163 shortcut for Iterable.min() => thanks to @Megamiun for the implementation
- #130 CharSequence.contains.elementsOf => thanks to @mattyway for the implementation
- #165 CharSequence.matches => thanks to @mikemolenda for the implementation
- #165 CharSequence.mismatches => thanks to @shardulsonar for the implementation
- #183 Array.asList => thanks to @piraces for the implementaiton
jdk8 extensions
- #108 Path.exists and Path.existsNot with excellent failure hints => big thanks to @jGleitz for the implementation
- #111 shortcut for Paht.isDirectory and Paht.isRegularFile => thanks to @jGleitz for the implementation
- #112 shortcut for Paht.isReadable and Paht.isWritable => thanks to @jGleitz for the implementation
- #187 Path.startsWith => thanks to @arjank for the implementation
- #189 Path.startsNotWith => thanks to @arjank for the implementation
- #188 Path.endsWith => thanks to @gaconkzk for the implementation
- #190 Path.endsNotWith => thanks to @segunfamisa for the implementation
- #109 shortcut for Path.fileName => thanks to @Tregz for the implementation
- #110 shortcut for Path.getParent => thanks to @lpicanco for the implementation
- #169 shortcut for Path.extension => thanks to @lelloman for the implementation
- #170 shortcut for Path.fileNameWithoutExtension => thanks to @aljacinto for the implementation
- #166 File.asPath => thanks to @lelloman for the implementation
- #261 LocalDate(Time) and ZonedDatetime.isBefore => thanks to @sandjelkovic for the start and @name213 for the finishing
- #261 LocalDate(Time) and ZonedDatetime.isBeforeOrEqual => thanks to @name213 for the implementation
- #175 LocalDate(Time) and ZonedDatetime.isAfter => thanks to @name213 for the implementation
- #262 LocalDate(Time) and ZonedDatetime.isAfterOrEqual => thanks to @lukebiddell for the implementation
- #290 LocalDate(Time) and ZonedDatetime.isEqual => thanks to @name213 for the implementation
- #174 shortcut for LocalDate(Time) and ZonedDatetime.year => thanks to @lpicanco for the implementation
- #175 shortcut for LocalDate(Time) and ZonedDatetime.month => thanks to @ShradhaSangtani for the implementation
- #176 shortcut for LocalDate(Time) and ZonedDatetime.day => thanks to @ShradhaSangtani for the implementation
- #175 shortcut for LocalDate(Time) and ZonedDatetime.dayOfWeek => thanks to @sanatik for the implementation
- #47 Optional.isEmpty => thanks to @arjank for the implementation
- #113 shortcut for Optional.get named isPresent => thanks to @slalu for the implementation
kotlin 1.3 extensions
- #203 Result.isSuccess => thanks to @shardulsonar
- #204 Result.isFailure => thanks to @johnGachihi
Domain / Core
Features for assertion-function-writers:
- introduced ExtractedFeaturePostStep and ChangedSubjectPostStep in order to have only one function on the domain level which covers both, narrowing features and features which expect an
assertionCreator
-lambda ExpectImpl.feature.extractor
ExpectImpl.builder.representationOnly
=> assertion without description but only a representation
Others
- #80 sample project for Atrium + junit5 => thanks to @bsemexan for the implementation
- #207 sample project for Atrium + jasmine => thanks to @bsemexan for the implementation
Fixes
- #143 domain-api-js was not included in bundle => thanks go to Darren Bell for reporting the issue
Improvements
- #160 CharSequence.containsRegex accepts now also a Regex => thanks to @neelkamath for the implementation
- #85 switch to
implement
instead ofcompile
in build.gradle where possible => thanks to @kssc0112 for the implementation
due to this cc-en_GB should no longer show up in cc-infix-en_GB - #193 update to spek 2.0.8 and use Spek's include => thanks to @Anubhav007 for the implementation
- #202 use spek-js instead of dummy impl => thanks to @wudmer for the implementation
- #239 spec for elementsOf empty iterable => thanks to @Megamiun for the implementation
- #218 update tutteli-spek-extensions to 1.0.1 => thanks to @ShradhaSangtani for the implementation
- #86 switch to native emoij => thanks to @Frandall
- #156 improve specs for iterable, use one time consumable iterables => thanks to @aljacinto for the analysis and implementation
- #296 git guide for newcomers as well as other fixes in CONTRIBUTING.md => thanks to @johnGachihi for the implementation
- #285 do not report value type for map contains values
- #297 rename ...OrEquals to ...OrEqual
- #298 remove isA check in toBe for nullable types
- #300 show only java's qualified name if different from kotlin => thanks to @Hubisco for the implementation
- #303 workaround KT-35882, set cause of AtriumError explicit to null
- #306 reword
number of occurrences
=> thanks to @Jak-Sidious for the implementation - #307 change assertion verb in reporting => thanks to @Jak-Sidious for the implementation
- #308 change toBe in reporting to
equals
=> thanks to @Hubisco for the implementation
Breaking Changes
Planned (previously deprecated or announced)
- none this time
Unplanned
- none this time
Deprecation
The following was deprecated and will be removed with 1.0.0:
- API cc-en_GB => use fluent-en_GB, infix-en_GB respectively
- API cc-de_CH => there won't be a replacement, vote for #137 if you used it, we recommend you switch to fluent-en_GB
- everything involving
Assert/AssertionPlant
and the like => switch toExpect
and the like - Assert.subject, which means Expect.subject is deprecated as well. Subject is passed as argument to lambdas which have to deal with it.
For instance, instead of writingcreateAndAddAssertion(TO_BE, expected) { subject == expected }
one has to writecreateAndAddAssertion(TO_BE, expected) { it == expected }
- ThrowableBuider including the assertion verb which dealt with exceptions (accepted a lambda) => can now be done with the regular expect function
- SubjectProvider and AssertionHolder, both introduced in this version and it might well be we remove it with 1.0.0
The following deprecations are planned for a future version
- this release does not yet include the new infix API. However, we are going to deprecate cc-infix-en_GB in favour of the new infix API infix-en_GB which is based on
Expect
as soon as the new infix API is ready. - AssertImpl will be deprecated in favour of ExpectImpl
Breaking Changes with 1.0.0
See atrium-roadmap -> Milestone 1.0.0
Migrating deprecated functionality
In case you migrate from a version < 0.7.0 then please have a look at the migration guide given in the Release Notes of 0.7.0 and 0.8.0.
Otherwise you can use the suggested replacements (ALT + Enter -> Replace with ...) or the search/replace patterns shown below.
Notice, that you don't have to migrate everything at once where asExpect
and asAssert
allow to switch between the old Assert
and the new Expect
world.
Ping us in the Atrium slack channel if you need help.
The following command is carrying out the points 1 to 11 described below (don't forget the points 12, 13, ...), run it from the root of your project, no guarantees that your system is capable of carrying it out. If not, you can use the manual steps described below
find ./ -path "*/test/*" -name "*.kt" | xargs perl -0777 -i \
-pe 's/AssertImpl([\n\r\s]*)\.changeSubject\(([^\)\n]...
v0.9.0-alpha2
v0.9.0-alpha2
v0.9.0-alpha
v0.9.0-alpha