-
Notifications
You must be signed in to change notification settings - Fork 299
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
Extend syntax for simple class name handling #41
Comments
codecholeric
added a commit
that referenced
this issue
Nov 8, 2017
Implement haveNameEndingWith / haveNameNotEndingWith Issue: #41
Thanks to @SteluHH by now there are already
|
codecholeric
added a commit
that referenced
this issue
Nov 8, 2017
- I've removed AndSimpleName, since the only thing with a simple name so far is JavaClass, and I can't think of any other future case - I've named everything consistently 'simple name', not 'simple class name', since the existing predicate refers just to 'simple name', and within the syntax, it should be clear that it refers to classes PR: #40 Issue: #41
Merged
codecholeric
added a commit
that referenced
this issue
Nov 18, 2017
… for that()...simpleName...() and added NamingConventionIntegrationTest to assert the behavior of those examples for the future. Issue: #41
codecholeric
pushed a commit
that referenced
this issue
Feb 21, 2021
codecholeric
added a commit
that referenced
this issue
Feb 21, 2021
Implement haveNameEndingWith / haveNameNotEndingWith Issue: #41
codecholeric
added a commit
that referenced
this issue
Feb 21, 2021
- I've removed AndSimpleName, since the only thing with a simple name so far is JavaClass, and I can't think of any other future case - I've named everything consistently 'simple name', not 'simple class name', since the existing predicate refers just to 'simple name', and within the syntax, it should be clear that it refers to classes PR: #40 Issue: #41
codecholeric
pushed a commit
that referenced
this issue
Feb 21, 2021
codecholeric
pushed a commit
that referenced
this issue
Feb 21, 2021
- Added an example IntegrationTest - Polished Javadoc Issue #41
codecholeric
added a commit
that referenced
this issue
Feb 21, 2021
… for that()...simpleName...() and added NamingConventionIntegrationTest to assert the behavior of those examples for the future. Issue: #41
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While one can do pretty much any filtering / assertion on class names using
haveNameMatching(regex)
, common use cases are to check the simple name forendsWith
,startsWith
orcontains
.These cases should be directly represented within the syntax, without thinking in regex. Thus we should add
classes().
that().haveSimpleNameEndingWith(..)
that().haveSimpleNameStartingWith(..)
that().haveSimpleNameContaining(..)
should().haveSimpleNameEndingWith(..)
should().haveSimpleNameStartingWith(..)
should().haveSimpleNameContaining(..)
and the respective negations (
notHave...
)The text was updated successfully, but these errors were encountered: