Rspec: Should be (this or that)

后端 未结 6 1178
無奈伤痛
無奈伤痛 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:01

    I'd probably write something like this:

    it "should be heads or tails" do
      ["heads", "tails"].should include flip_coin
    end
    

提交回复
热议问题