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
Since RSpec 2.11 you can also use match_array.
match_array
array.should match_array(another_array)
Which could be more readable in some cases.
[1, 2, 3].should =~ [2, 3, 1] # vs [1, 2, 3].should match_array([2, 3, 1])