0

I would like to know the equivalent of:

event.should be_live

in Minitest? The method I am testing is:

event.live?

At the moment I am using:

conf.live?.must_equal true

But it looks to me quite contrived.

rtacconi
  • 14,317
  • 20
  • 66
  • 84

1 Answers1

0

Newer versions of minitest allow testing predicates in assert_operator. The expectation for that in the spec DSL is must_be. So your code can look like:

event.must_be :live?
blowmage
  • 8,854
  • 2
  • 35
  • 40