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

introduce Comparable.isEqualComparingTo #484

Closed
10 tasks done
robstoll opened this issue Apr 28, 2020 · 4 comments · Fixed by #535
Closed
10 tasks done

introduce Comparable.isEqualComparingTo #484

robstoll opened this issue Apr 28, 2020 · 4 comments · Fixed by #535
Assignees
Labels
Milestone

Comments

@robstoll
Copy link
Owner

robstoll commented Apr 28, 2020

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

Code related feature

expect(comparable).isEqualComparingTo(otherComparable)

//instead of

expect(comparable.compareTo(otherComparable)).toBe(0)

And in reporting we want to see:

expected that subject: 1
- is equal comparing to: 2

Following the things you need to do:

lib

  • implement _isEqualComparingTo in comparableAssertions.kt (see other functions)
    • add DescriptionComparableAssertion.IS_EQUAL("is equal comparing to") for en_GB
    • add DescriptionComparableAssertion.IS_EQUAL("ist gleich wie") for de_CH

domain

  • extend ComparableAssertions with a function isEqualComparingTo (see other functions as a guideline)
  • modify ComparableAssertionsBuilder, delegate to comparableAssertions (see other functions as a guideline)
  • delegate implementation to robstoll-lib in ComparableAssertionsImpl (see other functions as a guideline)

api-fluent

  • provide the fun isEqualComparingTo in comparableAssertions.kt delegating to domain (see other functions as a guideline)
  • add @since 0.12.0 (adapt to current milestone) to KDOC
  • add isEqualComparingTo to ComparableAssertionsSpec in specs-common and adjust ComparableAssertionsSpec in atrium-api-fluent accordingly

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).
@jaibhavaya
Copy link
Contributor

I'll work on this

@jaibhavaya
Copy link
Contributor

jaibhavaya commented May 17, 2020

PR is in, this is my first contribution to anything open source, so I'm not totally sure if I have to do anything to link it to this issue.

#501

@robstoll
Copy link
Owner Author

No need to link it, I am going to review your PR tomorrow. I hope your first contribution was fun so far.

@jaibhavaya
Copy link
Contributor

It was great. Thanks so much for outlining this, it made it super approachable and was a blast to do.

robstoll added a commit that referenced this issue May 31, 2020
@robstoll robstoll added this to the 0.13.0 milestone May 31, 2020
@robstoll robstoll linked a pull request Jul 11, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants