Atrium: ChronoLocalDate(Time) and ChronoZonedDateTime.isAfterOrEquals

Created on 28 Oct 2019  路  9Comments  路  Source: robstoll/atrium

Platform (jvm, js, android): jvm
Extension (none, kotlin 1.3, jdk8): jdk8

Code related feature

expect(LocalDate.now().plusDays(1)).isAfterOrEquals(LocalDate.now())

Following the things you need to do (same same but different for ChronoLocalDateTime<out ChronoLocalDate> and ChronoZonedDateTime<out ChronoLocalDate>

domain-lib

  • add _isAfterOrEquals to chronoLocalDateAssertions.kt by using ExpectImpl.builder.createDescriptive(... (see comparableAssertions.kt)

    • add IS_AFTER("is after") to DescriptionDateTimeLikeAssertion for en_GB

    • add IS_AFTER("ist nach oder zeitgleich") to DescriptionDateTimeLikeAssertion for de_CH

domain

  • create ChronoLocalDateAssertions with a function isAfterOrEquals (see LocalDateAssertions as a guideline)
  • create ChronoLocalDateAssertionsBuilder, delegate to chronoLocalDateAssertions (see LocalDateAssertionsBuilder as a guideline)
  • create ChronoLocalDateAssertionsImpl and delegate implementation to robstoll-lib (see other functions as a guideline)

    • register ChronoLocalDateAssertions as new service in /domain/robstoll/atrium-domain-robstoll-jvm/src/main/resources/META-INF/services (see LocalDateAssertions as a guideline)

    • exclude it for JS in /build.gradle (search for createRegisterJsServicesTask)

api

  • provide a fun isAfterOrEquals which expects a ChronoLocalDate (see localDateAssertions as guideline)
  • add @since 0.9.0 (adopt to next release version) to KDOC of val and fun
  • cover new functionality in ChronoLocalDateAssertionsSpec in specs-jvm and extend it in atrium-api-fluent-en_GB-common/src/test

Your first contribution?

  • Write a comment I'll work on this if you would like to take this issue over.
    This way we get the chance to revise the description in case things have changed in the meantime,
    we might give you additional hints and we can assign the task to you, so that others do not start as well.
  • See Your first code contribution for guidelines.
  • Do not hesitate to ask questions here or to contact us via Atrium's slack channel if you need help
    (Invite yourself in case you do not have an account yet).
good first issue help wanted

All 9 comments

I'll work on this

@vivek0203 do you need any help? I am going to un-assign you again as I haven't heard anything from you. Happily assign you again if you are still working on it or in case you intend to start now.

I'll work on this

@lukebiddell isBefore is almost implemented, have a look at https://github.com/robstoll/atrium/pull/264/files in case you are stuck.

After forking, cloning then importing the build.gradle file and building it using ./gr build (following the instructions), all files are throwing me errors. Have you seen this before?

image

It seems to build fine, though I did get this error on importing. Unsure whether it is related.

8:37 PM Duplicate content roots detected Path [/home/.../atrium/bundles/cc-en_GB-robstoll/atrium-cc-en_GB-robstoll-jvm/src/test/kotlin] of module [atrium.atrium-cc-en_GB-robstoll-jvm.test] was removed from modules [atrium.atrium-cc-en_GB-robstoll-smoke-test.test] Also 2 more paths were deduplicated. See idea log for details

Unfortunately a bug in intellij (the unnamed module part) and there is no way to suppress it via intellij. A workaround is to use jdk8 in the project settings. Then intellij does not apply this wrong check.

You can also ignore the warning about the duplicated paths. Unfortunately a feature intellij does not support. I should have mentioned that in the guide. Would you like to improve it?

Btw. also the Warning about LocalDate is a final type is a bug of intellij 馃槖

Ah I see, so mainly problems with Intellij. Thanks for your help.

You can also ignore the warning about the duplicated paths. Unfortunately a feature intellij does not support. I should have mentioned that in the guide. Would you like to improve it?

I'll give it a go 馃憤

@lukebiddell I have update the description, I realised that the functions should be a bit different (see #289 for details)

implemented with 569373b

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dalewking picture dalewking  路  6Comments

robstoll picture robstoll  路  5Comments

robstoll picture robstoll  路  4Comments

robstoll picture robstoll  路  6Comments

robstoll picture robstoll  路  3Comments