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

change report for notToEqualNull #330

Closed
robstoll opened this issue Jan 25, 2020 · 1 comment · Fixed by #1572
Closed

change report for notToEqualNull #330

robstoll opened this issue Jan 25, 2020 · 1 comment · Fixed by #1572
Assignees
Labels
help wanted needs votes otherwise it will be ignored
Milestone

Comments

@robstoll
Copy link
Owner

robstoll commented Jan 25, 2020

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

Code related feature

expect(null as List<Int>?).notToEqualNull {
  toBeEmpty()
}

For this we currently see in reporting

expect: null
◆ to be an instance of type: List (kotlin.collections.List) -- Class: java.util.List
  » to be: empty

And we would like to see the following instead

expect: null
◆ not to equal: null but to be an instance of: List (kotlin.collections.List) -- Class: (java.util.List)
  » to be: empty

This means notToEqualNull has to do more than just delegating to toBeAnInstanceOf hence:

  • don't delegate simply to isA in DefaultAnyAssertions.notToBeNullBut
  • copy implementation of isA but change the options, to be more precise, change the description and the representation
  • change the implementation of notToEqual treat null specially so that expect(null as List<Int>?).notToBe(null) also results in the reporting above (without to be: empty of course) => we would need to break the API in order that this works. Won't do it now

Please react with 👍 if you would like to see this feature implemented in Atrium, the more upvotes the more likely I will implement it myself -- feel free to sponsor me, that would be a motivation too.
You are of course welcome to work on this issue. Write I'll work on it as comment so that we can assign the task to you.

@robstoll robstoll changed the title change report for notToBeNull change report for notToBeNull Jan 29, 2020
@robstoll robstoll added the needs votes otherwise it will be ignored label Apr 25, 2020
@robstoll robstoll added good first issue Good for newcomers and removed good first issue Good for newcomers labels Oct 1, 2020
@robstoll robstoll changed the title change report for notToBeNull change report for notToEqualNull Oct 9, 2021
@JordanllHarper
Copy link
Contributor

I'd like to work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted needs votes otherwise it will be ignored
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants