minitest-style-guide icon indicating copy to clipboard operation
minitest-style-guide copied to clipboard

Guides for assertion matcher.

Open abhaynikam opened this issue 5 years ago • 3 comments

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

abhaynikam avatar Aug 19 '19 06:08 abhaynikam

assert_send method is a deprecated method. https://github.com/seattlerb/minitest/blob/ab39d35fb4e84eb866ed9c4ecb707cbf3889de42/lib/minitest/assertions.rb#L393-L407

koic avatar Aug 20 '19 02:08 koic

Is there any reason why assert_same_elements isn't included in the guide?

ingemar avatar Sep 02 '22 13:09 ingemar

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

andyw8 avatar Sep 03 '22 04:09 andyw8

Ah! My bad! 😄

ingemar avatar Sep 05 '22 12:09 ingemar