The Sweet Spot
On software development, engineering leadership, machine learning and all things 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:

1
my_method.should =~ <my_expectation>

See the source.

Liking what you read?

Accelerate your engineering leadership by receiving my monthly newsletter!

    At most 1 email a month. Unsubscribe at any time.