AliSoftware / OHHTTPStubs

Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!
MIT License
5.03k stars 602 forks source link

Added `hasJsonBody(_:)` matcher for array #343

Open 417-72KI opened 3 years ago

417-72KI commented 3 years ago

Checklist

Description

I've added an overloaded matcher hasJsonBody that tests whether the NSURLRequest body contains a JSON array with the values on same order.

Motivation and Context

There is a matcher hasJsonBody for a JSON object ( created on #265 ). Unfortunately, it cannot be used when root of an object is an array (e.g. ["foo", "bar"]).