Question

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#.

Was it helpful?

Solution

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'

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top