What is the expected syntax for checking exception messages in MiniTest's assert_raises/must_raise?

后端 未结 4 1225
粉色の甜心
粉色の甜心 2020-12-25 09:39

What is the expected syntax for checking exception messages in MiniTest\'s assert_raises/must_raise?

I\'m trying to make an assertion somet

4条回答
  •  隐瞒了意图╮
    2020-12-25 09:53

    To add some more recent developments, there have been some discussions on adding assert_raises_with_message to minitest in the past without much luck.

    Currently, there is a promising pull request waiting to be merged. If and when it gets merged, we will be able to use assert_raises_with_message without having to define it ourselves.

    In the meanwhile, there is this handy little gem named minitest-bonus-assertions which defines exactly that method, along with few others, so that you can use it out of the box. See the docs for more information.

提交回复
热议问题