1require 'rspec/expectations/differ' 2 3RSpec::Matchers.define :equal_or_match_for_all_values do |expected| 4 match do |actual| 5 actual.values.equal_or_match? expected 6 end 7 8 failure_message_for_should do |actual| 9 full = { } 10 actual.keys.each do |engine| 11 full[engine] = expected 12 end 13 "Expected result to match #{expected.inspect} for all engines. Diff:" + diff.diff_as_object(actual, full) 14 end 15end 16