-
Return the contents of a
FileorPathnamebody given toto_return_json, or returned by its body lambda, instead of encoding the object as a JSON string (#1119)The file is read and closed as it is for
to_return: when the stub is declared, or on each request when it comes from a lambda.Thanks to Alex
-
Match HTTP methods given as a string or in upper case, as in
stub_request("get", ...),a_request("GET", ...)orassert_requested("post", ...)(#821)Before, such a method never matched, so the stub never applied and negative expectations like
assert_not_requested("get", ...)always passed. A test that passed only because of this can now fail.The method of a request is now always a lower case Symbol too. A request made with an upper case method, as Typhoeus does with
method: :POST, now matches a:poststub, and callbacks andwithblocks see:post.Thanks to Euisan Kim