-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add SemanticVersion.valid?
& SemanticVersion.parse?
#15051
base: master
Are you sure you want to change the base?
Add SemanticVersion.valid?
& SemanticVersion.parse?
#15051
Conversation
Co-authored-by: Sijawusz Pur Rahnama <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we should still have some basic specs to ensure the methods work.
@straight-shoota can you elaborate on what specifically? All the methods depend on the regex which is already tested in specs. |
Just a few simple calls to |
Can we get at least one successful test for each method? At the moment, even SemanticVersion.valid?("1.2.3").should be_true
SemanticVersion.parse?("1.2.3").should eq SemanticVersion.new(1, 2, 3) |
Hi @devnote-dev , thanks a lot for your contributions! We understand your reaction in this comment; having several rounds of reviews is tiring! Let me take a bit more of your time to understand what are we doing wrong. From our point of view, the comment suggesting specs was clear enough: "add successful and failing cases". Since only half of that was added in the subsequent commit, straight-shoota naturally asked for the other half. This seemed to not be excepcted, and therefore the reaction. First of all, and we need to make this more obvious to the contributors: whenever you're done with a PR, if you don't mind someone else taking over, you can leave it to us to do the final polish. And second, in order to improve future reviews, could you elaborate on why the first comment failed to transmit the expected outcome? Thanks once again for making Crystal better! |
@beta-ziliani Thank you for your acknowledgement. I don't mind having several rounds of reviews, but I do find these recent ones a bit unnecessary. I understand and support having full test coverage, but I also believe there's a point where testing is overdone. The I won't protest this issue as I've seen it become a blocker for valid contributions in the past, but I would like this issue to be taken into consideration for future contributions. |
@devnote-dev I agree it can feel repetitive or be over-testing, but such assumptions means that specs become implementation dependent. What if |
I wasn't sure if this required additional specs given that the underlying implementation (i.e. the regex) is the same. Closes #15020.