Skip to content
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

accept date and time as string in ISO 8601 format for ChronoLocalDateTime #481

Closed
10 tasks
robstoll opened this issue Apr 28, 2020 · 2 comments
Closed
10 tasks
Assignees
Labels
Milestone

Comments

@robstoll
Copy link
Owner

robstoll commented Apr 28, 2020

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

Code related feature

expect(LocalDateTime.now()).isAfter("2020-04-28T12:00")

//instead of

expect(LocalDateTime.now()).isAfter(LocalDateTime.of(2020,4,28,12,0))

Following the things you need to do:

atrium-logic:

  • duplicate each method in chronoLocalDateTimeAssertions.kt and:

api-fluent

  • duplicate each method in chronoLocalDateTimeAssertions.kt and:
    • accept a String instead of a ChronoLocalDateTime - call the corresponding domain function
    • change since to 0.12.0 (adapt to current milestone)
  • add the string version to ChronoLocalDateTimeAssertionsSpec:
    • add an object StringSpec, create functions in the companion object which corresponds to the signature of the existing functions (i.e. accept a ChronoLocalDateTime) where inside you turn the ChronoLocalDateTime into a string in ISO format and pass it to your new function
  • add describe("wrong string format") after the include(...) and add the following test-cases (use a map and forEach to generate the test-cases -- see DelegatingAssertionCheckerSpec for an example):
    • one passes a DateTime in format yyyymmddhhmmssSSS
    • one passes a DateTime in format yyyymmddhhmmss
    • one passes a DateTime in format yyyymmddhhmm
    • one passes a DateTime in format yyyymmdd
    • one passes a DateTime in format yyyy-m-ddThh:mm
    • one passes a DateTime in format yyyy-mm-dThh:mm
    • one passes a DateTime in format yy-mm-ddThh:mm
    • one passes a DateTime in format yyyy-mm-ddTh:mm
    • one passes a DateTime in format yyyy-mm-ddThh:m
    • one passes a DateTime in format yyyy-mm-ddThh:mm:s
    • one passes a DateTime in format yyyy-mm-ddthh:mm (note lower case t)
  • add describe("allowed shortcuts") with the following test cases:
    • one passes a DateTime in format yyyy-mm-ddThh:mm:ss
    • one passes a DateTime in format yyyy-mm-ddThh:mm
    • one passes a DateTime in format yyyy-mm-dd
  • add the string version to the ambiguityTests in ChronoLocalDateTimeAssertionsSpec

api-infix

  • same same but different

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).
assaflei pushed a commit to assaflei/atrium that referenced this issue May 15, 2020
introduce typealias CharSequenceOrNumberOrChar for Any

move CharSequenceOrNumberOrChar to domain-api and use in domain-impl

update setup instructions for the new infix API

include the new infix API to be published

preparation for accepting String instead of Zoned/LocalDate(Time) object

preparation for robstoll#480, robstoll#481 and robstoll#482

refer to current milestone in good_first_issue template

fix link for nullableContainer

return empty message in case callee is org.spekframework.ide

reduce code duplication also for jvm specs, add more cases to PathSpec

fix wrong replacements and workaround KT-38721 (add import next to star)

api-fluent work done

commiting requested changes

updated with comments

adding problematic classes which break the build

adding problemtic code to server to reproduce error

reproducing problematic build on CI

fix to build problem

addressing latest comment, build should pass

adjust the pseudo-keyword from exist to existing

moved infix jdk8 extension to jvm module

rebasing
assaflei pushed a commit to assaflei/atrium that referenced this issue May 15, 2020
introduce typealias CharSequenceOrNumberOrChar for Any

move CharSequenceOrNumberOrChar to domain-api and use in domain-impl

update setup instructions for the new infix API

include the new infix API to be published

preparation for accepting String instead of Zoned/LocalDate(Time) object

preparation for robstoll#480, robstoll#481 and robstoll#482

refer to current milestone in good_first_issue template

fix link for nullableContainer

return empty message in case callee is org.spekframework.ide

reduce code duplication also for jvm specs, add more cases to PathSpec

fix wrong replacements and workaround KT-38721 (add import next to star)

api-fluent work done

commiting requested changes

updated with comments

adding problematic classes which break the build

adding problemtic code to server to reproduce error

reproducing problematic build on CI

fix to build problem

addressing latest comment, build should pass

adjust the pseudo-keyword from exist to existing

moved infix jdk8 extension to jvm module

rebasing
robstoll added a commit that referenced this issue May 15, 2020
* build windows also against JDK 11

introduce typealias CharSequenceOrNumberOrChar for Any

move CharSequenceOrNumberOrChar to domain-api and use in domain-impl

update setup instructions for the new infix API

include the new infix API to be published

preparation for accepting String instead of Zoned/LocalDate(Time) object

preparation for #480, #481 and #482

refer to current milestone in good_first_issue template

fix link for nullableContainer

return empty message in case callee is org.spekframework.ide

reduce code duplication also for jvm specs, add more cases to PathSpec

fix wrong replacements and workaround KT-38721 (add import next to star)

api-fluent work done

commiting requested changes

updated with comments

adding problematic classes which break the build

adding problemtic code to server to reproduce error

reproducing problematic build on CI

fix to build problem

addressing latest comment, build should pass

adjust the pseudo-keyword from exist to existing

moved infix jdk8 extension to jvm module

rebasing

* added file deprecation suppress message + removed niok and kbox references

* resolving comments in re
@rkiselev
Copy link
Contributor

rkiselev commented Jul 4, 2020

I'll work on this

rkiselev added a commit to rkiselev/atrium that referenced this issue Jul 12, 2020
rkiselev added a commit to rkiselev/atrium that referenced this issue Jul 12, 2020
# Conflicts:
#	misc/deprecated/domain/robstoll-lib/atrium-domain-robstoll-lib-jvm/src/main/kotlin/ch/tutteli/atrium/domain/robstoll/lib/creating/chronoLocalDateTimeAssertions.kt
rkiselev added a commit to rkiselev/atrium that referenced this issue Jul 12, 2020
robstoll pushed a commit that referenced this issue Jul 13, 2020
robstoll pushed a commit that referenced this issue Jul 13, 2020
rkiselev added a commit to rkiselev/atrium that referenced this issue Jul 26, 2020
rkiselev added a commit to rkiselev/atrium that referenced this issue Jul 26, 2020
…ll#481-chrono-local-date-time

# Conflicts:
#	apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeAssertionSpec.kt
#	logic/atrium-logic-jvm/src/main/kotlin/ch/tutteli/atrium/logic/impl/DefaultChronoLocalDateTimeAssertions.kt
rkiselev added a commit to rkiselev/atrium that referenced this issue Jul 26, 2020
rkiselev added a commit to rkiselev/atrium that referenced this issue Jul 26, 2020
rkiselev added a commit to rkiselev/atrium that referenced this issue Aug 8, 2020
rkiselev added a commit to rkiselev/atrium that referenced this issue Aug 8, 2020
rkiselev added a commit to rkiselev/atrium that referenced this issue Aug 8, 2020
…stoll#481-chrono-local-date-time

# Conflicts:
#	apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/main/kotlin/ch/tutteli/atrium/api/fluent/en_GB/chronoLocalDateTimeAssertions.kt
#	apis/fluent-en_GB/atrium-api-fluent-en_GB-jvm/src/test/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeAssertionSpec.kt
rkiselev pushed a commit to rkiselev/atrium that referenced this issue Aug 19, 2020
rkiselev pushed a commit to rkiselev/atrium that referenced this issue Aug 19, 2020
robstoll pushed a commit that referenced this issue Aug 19, 2020
…DateTime 2 (#552)

#481 added String parameter instead of a ChronoLocalDateTime
@robstoll robstoll added this to the 0.13.0 milestone Aug 19, 2020
robstoll added a commit that referenced this issue Aug 19, 2020
@robstoll
Copy link
Owner Author

implemented with #556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants