lib/pacto/response.rb in pacto-0.1.1 vs lib/pacto/response.rb in pacto-0.2.0
- old
+ new
@@ -19,9 +19,13 @@
unless @definition['headers'].normalize_keys.subset_of?(response.headers.normalize_keys)
return [ "Invalid headers: expected #{@definition['headers'].inspect} to be a subset of #{response.headers.inspect}" ]
end
- JSON::Validator.fully_validate(@definition['body'], response.body)
+ if @definition['body']
+ JSON::Validator.fully_validate(@definition['body'], response.body)
+ else
+ []
+ end
end
end
end