-
Notifications
You must be signed in to change notification settings - Fork 39
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 Minitest assertion annotations #276
Conversation
9b9d7f1
to
a19c360
Compare
Worth having a type alias for |
1263ada
to
5b58dec
Compare
That's not possible because our CI checks to see if all constants exist in the runtime and the type alias wouldn't. |
32fd09d
to
b1c0d93
Compare
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.
Can we sort these annotations by name?
@Morriar Better yet, I'd rather have them in the same order as https://github.com/minitest/minitest/blob/master/lib/minitest/assertions.rb Like so: 8cf2e73 |
b1c0d93
to
27d439a
Compare
Sorted based on how they are declared in Minitest and improved the signature for assert_raises, which now returns the right type depending on the exception classes passed. |
5df98d2
to
8c4df54
Compare
8c4df54
to
aa7b48b
Compare
Type of Change
Changes
Now that we have untyped statistics, better typing Minitest assertions is important to remove them from the data - since they don't actually indicate any lack of safety. The reason is because we invoke so many assertions in the many many tests we have that they end up polluting the results with a bunch of untypeds.
This PR adds Minitest annotations, but only for assertions. Most of the other methods defined in the Minitest gem are only invoked by the gem itself, developers almost always interact only with assertions.
Note
I have tested this on Core and it found maaaany cases of the incorrect usage of custom failure messages:
The fixes are quite straight forward, but it will be a big PR.