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

Comparison API in assertj module #129

Merged
merged 13 commits into from
Aug 2, 2018
Merged

Comparison API in assertj module #129

merged 13 commits into from
Aug 2, 2018

Conversation

krystiankaluzny
Copy link
Member

PR provide CompareAssert that is equivalent for CompareMatcher

From now xmlunit-assert module covers same features as xmlunit-matchers.
And for now I don't have a plan for further development.

@coveralls
Copy link

coveralls commented Jul 29, 2018

Coverage Status

Coverage decreased (-0.6%) to 91.338% when pulling 318130c on assertj-support into f6a8ccd on master.

Copy link
Member

@bodewig bodewig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, many thanks!

I'm not really familiar with AssertJ's philosophy but I would have expected areNotSimilar in addition to areDifferent.

Some of the new test classes lack the license header and we may want to look into test coverage later (I'm not sure Coveralls caught your follow up commit).

@bodewig bodewig mentioned this pull request Jul 30, 2018
@krystiankaluzny
Copy link
Member Author

In AssertJ there are examples of pair of methods that do same things, but have different names
So if yout think that areNotSimilar is more appropriate, I don't see any reason not to add that method.

I can also add areNotIdentical aka similar or completely different.

I notice that Coveralls have problem with try-catch blocks that look like below and it is main reason of decreasing coverage.

try {
	do()
} catch(Exception e) {
	throwMessage()
}

...
void throwMessage() {
	thorw new AssertError()
}

I have to admit that I didn't write tests for all CompareAssert's methods :)
Most of that methods delegate work to DiffBuilder, so I decide that it's pointless to write the same tests as in DiffBuilderTest. I can cover this gap if you wish.

Of course missing license headers will be added.

@bodewig
Copy link
Member

bodewig commented Jul 31, 2018

Sorry, of course areNotSimilar and areDifferent do the same, my fault. What I really wanted to ask is for having areNotIdentical as you suggest. I really was only asking whether it would be a good idea to have two negative assertions to go with the two positive assertions.

As for coverage I really haven't checked where coveralls currently thinks we lack tests, if it is a false positive, then we'll simply have to accept it.

- areNotIdentical
- areNotSimilar in place of areDifferent
@bodewig
Copy link
Member

bodewig commented Aug 2, 2018

still looks good to me :-)

Please merge the PR yourself when you consider it ready as I'm not as available as usual right now.

@krystiankaluzny krystiankaluzny merged commit 76226ec into master Aug 2, 2018
@bodewig
Copy link
Member

bodewig commented Aug 7, 2018

@krystiankaluzny do you think we can close #117 now or is there anything left you'd like to add?

@krystiankaluzny
Copy link
Member Author

The only thing I'm going to do is write user guide page. If you don't mind I would leave the issue open until then.

@bodewig
Copy link
Member

bodewig commented Aug 8, 2018

Sure, fine with me. I hope to carve out some time this week and write a few additional tests - because it is my way of understanding APIs and not (only) to improve some silly stats.

@krystiankaluzny krystiankaluzny deleted the assertj-support branch August 16, 2018 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants