diff --git a/lib/pact_broker/pacts/sort_content.rb b/lib/pact_broker/pacts/sort_content.rb index 47a0b5418..702c34da4 100644 --- a/lib/pact_broker/pacts/sort_content.rb +++ b/lib/pact_broker/pacts/sort_content.rb @@ -34,7 +34,7 @@ def self.order_verifiable_content probably_array # You never can tell what people will do... if probably_array.is_a?(Array) array_with_ordered_hashes = order_hash_keys(probably_array) - array_with_ordered_hashes.sort{ |a, b| a.to_json <=> b.to_json } + array_with_ordered_hashes.sort_by(&:to_json) else probably_array end