Method: Pact::CSV::Differ#compare

Defined in:
lib/pact/csv/differ.rb

#compare(expected, actual, options) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/pact/csv/differ.rb', line 25

def compare(expected, actual, options)
  expected_table = Cucumber::Ast::Table.new(expected.map(&:to_hash))
  actual_table = Cucumber::Ast::Table.new(actual.map(&:to_hash))
  errors = []
  begin
    p options
    expected_table.diff!(actual_table, surplus_col: options["allow_unexpected_keys"])
  rescue => e
    errors = [e.table]
  end
  errors
end