You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it'd be useful to have a matcher (or change uri) to compare query parameters ignoring their order. I was able to implement that with a custom matcher:
func uriWithQuery(uriString:String)->(request:NSURLRequest)->Bool{return{(request:NSURLRequest)in
if uri(uriString)(request: request){return true
}
if let components =NSURLComponents(string: uriString),
requestComponents = request.URL.flatMap({NSURLComponents.init(URL: $0, resolvingAgainstBaseURL: false)}){letcomponentsWithoutParams= components.copy()as!NSURLComponents
componentsWithoutParams.query =nilletrequestComponentsWithoutParams= requestComponents.copy()as!NSURLComponents
requestComponentsWithoutParams.query =nil
if requestComponentsWithoutParams.URL == componentsWithoutParams.URL {return requestComponents.queryItems.flatMap(Set.init)== components.queryItems.flatMap(Set.init)}}
return false
}}
Note that this probably doesn't support path templates.
The text was updated successfully, but these errors were encountered:
I think it'd be useful to have a matcher (or change
uri
) to compare query parameters ignoring their order. I was able to implement that with a custom matcher:Note that this probably doesn't support path templates.
The text was updated successfully, but these errors were encountered: