diff --git a/lib/pact/reification.rb b/lib/pact/reification.rb index dcbe4e2..bbfbc2c 100644 --- a/lib/pact/reification.rb +++ b/lib/pact/reification.rb @@ -5,6 +5,7 @@ require 'pact/shared/request' require 'pact/consumer_contract/query_hash' require 'pact/consumer_contract/query_string' +require 'pact/consumer_contract/string_with_matching_rules' module Pact module Reification @@ -35,6 +36,8 @@ def self.from_term(term) "#{k}=#{escape(v)}" end }.join('&') + when Pact::StringWithMatchingRules + String.new(term) else term end diff --git a/spec/lib/pact/reification_spec.rb b/spec/lib/pact/reification_spec.rb index 4a83d22..94d9f84 100644 --- a/spec/lib/pact/reification_spec.rb +++ b/spec/lib/pact/reification_spec.rb @@ -160,5 +160,13 @@ module Pact expect(subject).to eq("param=1¶m=1") end end + + context "with a StringWithMatchingRules" do + subject { Reification.from_term(StringWithMatchingRules.new("foo", Pact::SpecificationVersion.new("3"), {}))} + + it "returns a String" do + expect(subject.class).to be String + end + end end end