0

I would like to use fluent assertions type of syntax with minitest

result.should_be "my result"
result.should_be_true
result.should_contain "foo"

Is there some gem that adds this functionality?

My request come from a similar idea in C#.

toro2k
  • 19,020
  • 7
  • 64
  • 71
David MZ
  • 3,648
  • 6
  • 33
  • 50

2 Answers2

3

Minitest already comes with its own module for this kind of assertions, it is Minitest::Expectations

result.must_equal 'my result'
result.must_equal true
result.must_include 'foo'
result.wont_include 'bar'
toro2k
  • 19,020
  • 7
  • 64
  • 71
0

rspec adds this assertion type, you can check out the gem here: https://github.com/rspec/rspec-rails

Christian-G
  • 2,371
  • 4
  • 27
  • 47