Fix specs on Ruby 2.1.0

Fixes #1064. See issue for more info. TL;DR: Ruby 2.1.0 has different order for uniq, which makes some tests fail.

28a9911 is the simplest possible fix I could come up with, but which I found ugly to read. So 47b9249 implements an `assert_permutation` method to match ignoring class order.