rspec function for testing order-independent array equality