I often want to compare arrays and make sure that they contain the same elements, in any order. Is there a concise way to do this in RSpec?
Here are methods that are
I've found =~ to be unpredictable and it has failed for no apparent reason. Past 2.14, you should probably use
=~
expect([1, 2, 3]).to match_array([2, 3, 1])