Sha256: 530f7635995166407c1b834a3352d3cdc52c5035fdf404d4a01c2b36222bfe2c
Contents?: true
Size: 564 Bytes
Versions: 11
Compression:
Stored size: 564 Bytes
Contents
def compare_array_of_hashes(expected, actual) expected.each_with_index do |expected_hash, index| compare_hash(expected_hash, actual[index]) end end def compare_hash(expected_hash, actual_hash) expected_hash.each_pair do |key, expected| actual = actual_hash[key] if expected.is_a?(Regexp) assert_match expected, actual, "#{key} does not match. Expected #{expected.inspect}. Actual #{actual.inspect}" else assert_equal expected, actual, "#{key} not equal. Expected #{expected.inspect}. Actual #{actual.inspect}" end end end
Version data entries
11 entries across 11 versions & 1 rubygems