Sha256: dbba8ebbacaa8e409ed7a573156e5da6f4c4de0d64a3aac34d45e696ca8f9c8c
Contents?: true
Size: 568 Bytes
Versions: 13
Compression:
Stored size: 568 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].to_s 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
13 entries across 13 versions & 1 rubygems