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

Version Path
rocketjob_mission_control-4.3.0 test/compare_hashes.rb
rocketjob_mission_control-4.2.1 test/compare_hashes.rb
rocketjob_mission_control-4.2.0 test/compare_hashes.rb
rocketjob_mission_control-4.1.0 test/compare_hashes.rb
rocketjob_mission_control-4.0.0 test/compare_hashes.rb
rocketjob_mission_control-3.2.0 test/compare_hashes.rb
rocketjob_mission_control-3.1.0 test/compare_hashes.rb
rocketjob_mission_control-3.0.3 test/compare_hashes.rb
rocketjob_mission_control-3.0.2 test/compare_hashes.rb
rocketjob_mission_control-3.0.1 test/compare_hashes.rb
rocketjob_mission_control-3.0.0 test/compare_hashes.rb