質問

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

役に立ちましたか?

解決

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'

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top