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

rename Date assertions isWithinXXX to hasSameXXXAs #143

Open
joel-costigliola opened this issue Feb 4, 2013 · 0 comments
Open

rename Date assertions isWithinXXX to hasSameXXXAs #143

joel-costigliola opened this issue Feb 4, 2013 · 0 comments

Comments

@joel-costigliola
Copy link
Contributor

I was never comfortable with isWithinXXX assertions (event though it was my idea ...), reading them after a while, I find it confusing, if you write ...

assertThat(date).isWithinSecond(otherDate);

... then do you want to compare seconds field of dates only or dates to seconds precision (in our case it is second field comparison only).

I come up with a clearer name (I think) : hasSameXXXFieldAs

So instead of

assertThat(date).isWithinSecond(otherDate);

We would have

assertThat(date).hasSameSecondFieldAs(otherDate);
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

1 participant