Rspec: Should be (this or that)

后端 未结 6 1197
無奈伤痛
無奈伤痛 2020-12-16 09:38

What would be the best way to write the rspec in a situation where either of two (or more) outcomes are acceptable?

Here\'s an example of what I want to do. This is

6条回答
  •  生来不讨喜
    2020-12-16 10:17

    You can solve this by flipping the comparison:

    expect(['head','tails']).to include(flip_coin)

提交回复
热议问题