Class: Fictium::Postman::V2Exporter::ResponseFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/fictium/exporters/postman/v2_exporter/response_formatter.rb

Instance Method Summary collapse

Instance Method Details

#format(example) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/fictium/exporters/postman/v2_exporter/response_formatter.rb', line 5

def format(example)
  base_info_for(example).tap do |result|
    body = body_formatter.format(example.response, response: true)
    header = header_formatter.format(example.response)
    result[:body] = body if body.present?
    result[:header] = header if header.present?
  end
end