应该是最小的等价物

时间:2013-04-05 09:34:19

标签: ruby rspec minitest

我想知道相当于:

event.should be_live

在Minitest?我正在测试的方法是:

event.live?

目前我正在使用:

conf.live?.must_equal true

但它看起来非常人为。

1 个答案:

答案 0 :(得分:0)

较新版本的minitest允许在assert_operator中测试谓词。规范DSL中对此的期望是must_be。所以你的代码看起来像:

event.must_be :live?
相关问题