The Sweet Spot
On software, engineering leadership, and anything shiny.

RSpec order-agnostic array matching

What’s that? You want to write an expectation for an array but your method returns the Array in a nondeterministic ordering?

Simple. Write:

my_method.should =~ <my_expectation>

See the source.

Comments