提交 036a7a03 编写于 作者: K Kasper Timm Hansen

Memoize `parsed_body`.

It's common to use several assertions on the parsed response. The response
bodies aren't meant to be mutated. People should make new test requests
instead.

Thus, it should be safe to memoize the parsing.
上级 5007df5e
......@@ -22,7 +22,7 @@ def self.from_response(response)
attr_writer :response_parser # :nodoc:
def parsed_body
@parsed_body ||= @response_parser.call(body)
@response_parser.call(body)
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册