Sha256: 0b917ca5af11bc5bcb5009de41efb78de6d0ea2aee24040db8bc245123626b76

Contents?: true

Size: 420 Bytes

Versions: 3

Compression:

Stored size: 420 Bytes

Contents

require 'pact/matchers/matchers'
require 'uri'

module Pact
  class FormDiffer

    extend Matchers

    def self.call expected, actual, options = {}
      diff to_hash(expected), to_hash(actual), options
    end

    def self.to_hash form_body
      URI.decode_www_form(form_body).each_with_object({}) do | pair, hash |
        hash[pair.first] ||= []
        hash[pair.first] << pair.last
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pact-support-0.1.1 lib/pact/shared/form_differ.rb
pact-support-0.1.0 lib/pact/shared/form_differ.rb
pact-support-0.0.4 lib/pact/shared/form_differ.rb