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

Deprecate the Is matcher, for eventual deletion #88

Open
npryce opened this issue Dec 24, 2014 · 5 comments
Open

Deprecate the Is matcher, for eventual deletion #88

npryce opened this issue Dec 24, 2014 · 5 comments
Milestone

Comments

@npryce
Copy link
Contributor

npryce commented Dec 24, 2014

The Is matcher doesn't do anything, and so should be deleted.

Factory methods for is should not be added to the domain-specific factory classes introduced as part of #85

@npryce npryce added this to the 7.0 milestone Dec 24, 2014
@npathai
Copy link
Contributor

npathai commented Dec 26, 2014

@npryce doesn't Is matcher provide a better language like feel to the assert statements?
assertThat(object1, is(equalTo(object2)); sounds much natural than assertThat(object1, equalTo(object2));

@npryce
Copy link
Contributor Author

npryce commented Dec 26, 2014

Yes. This issue is for the deprecation. Deletion is another issue.

On Thursday, December 25, 2014, Steve Freeman notifications@github.com
wrote:

Probably should be deprecated first. There are lots of people who seem to
like it.


Reply to this email directly or view it on GitHub
#88 (comment)
.

@npryce
Copy link
Contributor Author

npryce commented Dec 26, 2014

Hamcrest doesn't aim to replicate natural language but implement a
compositional notation in which each component of an expression means
something. The is matcher goes against that design. It's a historical
mistake.

On Friday, December 26, 2014, Narendra Pathai notifications@github.com
wrote:

@npryce https://github.com/npryce doesn't Is matcher provide a better
language like feel to the assert statements?
assertThat(object1, is(equalTo(object2)); sounds much natural than assertThat(object1,
equalTo(object2));


Reply to this email directly or view it on GitHub
#88 (comment)
.

@npathai
Copy link
Contributor

npathai commented Dec 26, 2014

@npryce Aha now I got it. Thanks.

@tumbarumba tumbarumba modified the milestones: 2.1.0.0, 2.3 Dec 28, 2022
@CC007
Copy link

CC007 commented Jan 24, 2023

I like the is(value) shortcut. It's shorter to type and as npryce pointed out is more natural to read. I do agree that is(matcher) is a bit overkill since it doesn't change the matcher outcome compared to the contained matcher, but I also agree that for readability I like the option to use it. Also, its existence doesn't hurt anything and removing it will therefore only be a hassle for end-users since it would be a breaking change.

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

No branches or pull requests

4 participants