lib/pact/request.rb in pact-0.1.35 vs lib/pact/request.rb in pact-0.1.37

- old
+ new

@@ -83,10 +83,27 @@ def as_json_without_body keep_keys = [:method, :path, :headers, :query] as_json.reject{ |key, value| !keep_keys.include? key } end + def short_description + "#{method} #{full_path}" + end + + def full_path + fp = '' + if path.empty? + fp << "/" + else + fp << path + end + if query && !query.empty? + fp << ("?" + query) + end + fp + end + end class Expected < Base DEFAULT_OPTIONS = {:allow_unexpected_keys => false}.freeze @@ -126,9 +143,13 @@ diff({:body => body}, {body: actual_body}, allow_unexpected_keys: runtime_options[:allow_unexpected_keys_in_body]) end def as_json_with_options as_json.merge( options.empty? ? {} : { options: options} ) + end + + def generated_body + Pact::Reification.from_term(body) end # Don't want to put the default options in the pact json just yet, so calculating these at run time, rather than assigning # the result to @options def runtime_options