-
Couldn't load subscription status.
- Fork 217
How to extend Pact for different content types
Beth Skurrie edited this page Jun 9, 2016
·
1 revision
This must return a structure representing the differences between the expected and the actual content.
eg. The existing Pact JSON Differ and the bare bones of the XML Differ here
This should accept the diff created by the differ, and turn it into a string in a human readable format. Some examples are the UnixDiffFormatter and the EmbeddedDiffFormatter. For an example of how the diffs are represented, have a look at the documentation.
require 'pact'
require 'pact/xml'
Pact.configure do | config |
config.register_body_differ /xml/, Pact::XML::Differ
config.register_diff_formatter /xml/, Pact::XML::DiffFormatter
end