Fix repository spec
Define repository equality and avoid Array#to_h to support ruby < 2.1.0