Sha256: b86fa95ea67a640bebf8e301f92d524fefa8f0846219efdedec74b7ca21a3f28
Contents?: true
Size: 1.17 KB
Versions: 67
Compression:
Stored size: 1.17 KB
Contents
require 'pact_broker/pacts/generate_interaction_sha' module PactBroker module Pacts describe GenerateInteractionSha do describe ".call" do let(:interaction_hash) do { "description" => "foo", "providerStates" => [ "name" => "bar", "params" => { "wiffle" => "bar", "meep" => "eek" } ] } end let(:interaction_hash_with_different_key_order) do { "providerStates" => [ "name" => "bar", "params" => { "meep" => "eek", "wiffle" => "bar" } ], "description" => "foo" } end subject { GenerateInteractionSha.call(interaction_hash) } it "generates a SHA based on the sorted keys" do expect(subject).to eq "57d06e151eca35083e4d6b585b4d4fab2e2ed6b7" end it "generates the same SHA if the keys are ordered differently" do expect(subject).to eq GenerateInteractionSha.call(interaction_hash_with_different_key_order) end end end end end
Version data entries
67 entries across 67 versions & 1 rubygems