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

Version Path
rocketjob_mission_control-6.1.0 test/compare_hashes.rb
rocketjob_mission_control-6.0.7 test/compare_hashes.rb
rocketjob_mission_control-6.0.6 test/compare_hashes.rb
rocketjob_mission_control-6.0.5 test/compare_hashes.rb
rocketjob_mission_control-6.0.4 test/compare_hashes.rb
rocketjob_mission_control-6.0.3 test/compare_hashes.rb
rocketjob_mission_control-6.0.2 test/compare_hashes.rb
rocketjob_mission_control-6.0.1 test/compare_hashes.rb
rocketjob_mission_control-6.0.0 test/compare_hashes.rb
rocketjob_mission_control-6.0.0.beta test/compare_hashes.rb
rocketjob_mission_control-5.0.1 test/compare_hashes.rb
rocketjob_mission_control-5.0.0 test/compare_hashes.rb
rocketjob_mission_control-5.0.0.beta1 test/compare_hashes.rb