-
Notifications
You must be signed in to change notification settings - Fork 311
Implement haveNameEndingWith / haveNameNotEndingWith #40
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
Conversation
…he necessity to use a regex for that concern
Thanks a lot for your PR 😃 Originally I thought about it, and I feared the complexity (okay, it was lazyness 😉). Since if we add However, I'm wondering, if it is really "name ends with", that we want. I have had this use case as well (and used regex 😉), and what I wanted to assert, was the simple name. As far as I understand, it's the same for your case. Usually this would be kind of irrelevant, but when the 'symmetric' You don't have to implement the full issue of course, I'm happy, to merge the
|
PS: I don't know about the unit tests, since the Travis CI build seems to run successfully? Hope that's not an inconsistency between your local build and the CI build (I hoped the Gradle Wrapper would minimize those dangers). |
Hi, originally I also thought to implement startingWith and then noticed that it would match against the package name instead of the classname, since I was using name() instead of simpleName(). I think you are right with the hint that it would be better to rename the whole method to Regarding the endsWith, on my first draft I wanted to have it like this, but then failed with some UnitTests (RandomRuleTest), that on first sight seemed to check my method signatures against the descripting text. When I thought more about the English text I came to the conclusion that it must be either |
…ssName instead of fully qualified classname
I hereby agree to the terms of the ArchUnit Contributor License Agreement. ;-) |
Thanks a lot for your contribution and adjusting this, I'm gonna merge it now 😃 |
Hi @codecholeric Thanks for merging, when I have time I will contribute again. I see lots of potential in your framework, thanks for the great job. |
- 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
Implement haveNameEndingWith / haveNameNotEndingWith Issue: #41
- 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
When I was using the framework I wanted to make sure, that EventHandlers in our project are always called *EventHandler. Since no such method "endsWith" exists, I had to use a regex for that. I don't like that too much, so I thought I use the chance for my very first OpenSource contribution and here it is :)
For some reason 9 Unit tests are failing, however they also fail without my changes.