Have you ever written an RSpec test similar to this?
It’s not clearly obvious which part of this test is the “exercise” and which is the “verify” phase, as outlined by xUnit’s Four-Phase Test.
You could switch to
do...end block style, but
end.to doesn't look very idiomatic.
There is an alternative to writing this, where the phases are more distinct and identified more easily. With the help of Ruby
lambda we can rewrite our test as: