minitest-style-guide
minitest-style-guide copied to clipboard
Guides for assertion matcher.
Following are the assertion for which guides are still remaining. I am planning to work on them today and Raise PRs for each. Please do let me know if there is any objection or concern regarding adding any of the matchers or the way I work. 😄
FYI, I haven't used few of the matchers at all. I would be trying them on sample application and then raise the PRs 🙏
- [x]
assert_operator
/refute_operator
- [x]
assert_output
/refute_output
- [x]
assert_predicate
/refute_predicate
- [ ]
assert_raises
/refute_raises
- [x]
assert_respond_to
/refute_respond_to
- [ ]
assert_same
/refute_same
- [ ] ~~
assert_send
/refute_send
~~ https://github.com/rubocop-hq/minitest-style-guide/issues/15#issuecomment-522825756 - [ ]
assert_silent
/refute_silent
- [ ]
assert_throws
/refute_throws
cc/ @koic @bbatsov
assert_send
method is a deprecated method.
https://github.com/seattlerb/minitest/blob/ab39d35fb4e84eb866ed9c4ecb707cbf3889de42/lib/minitest/assertions.rb#L393-L407
Is there any reason why assert_same_elements
isn't included in the guide?
There no such method in minitest, it's added by other libraries, e.g. https://www.rubydoc.info/gems/minitest-rails-shoulda/0.4.1/MiniTest%2FAssertions%3Aassert_same_elements
Ah! My bad! 😄