{"action":"created","issue":{"url":"https://api.github.com/repos/AliSoftware/OHHTTPStubs/issues/129","labels_url":"https://api.github.com/repos/AliSoftware/OHHTTPStubs/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/AliSoftware/OHHTTPStubs/issues/129/comments","events_url":"https://api.github.com/repos/AliSoftware/OHHTTPStubs/issues/129/events","html_url":"https://github.com/AliSoftware/OHHTTPStubs/pull/129","id":111735368,"number":129,"title":"Add methods to create `OHHTPStubResponse`s from `NSURL`s","user":{"login":"MaxGabriel","id":1274145,"avatar_url":"https://avatars.githubusercontent.com/u/1274145?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxGabriel","html_url":"https://github.com/MaxGabriel","followers_url":"https://api.github.com/users/MaxGabriel/followers","following_url":"https://api.github.com/users/MaxGabriel/following{/other_user}","gists_url":"https://api.github.com/users/MaxGabriel/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxGabriel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxGabriel/subscriptions","organizations_url":"https://api.github.com/users/MaxGabriel/orgs","repos_url":"https://api.github.com/users/MaxGabriel/repos","events_url":"https://api.github.com/users/MaxGabriel/events{/privacy}","received_events_url":"https://api.github.com/users/MaxGabriel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-16T00:40:03Z","updated_at":"2015-10-16T22:57:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/AliSoftware/OHHTTPStubs/pulls/129","html_url":"https://github.com/AliSoftware/OHHTTPStubs/pull/129","diff_url":"https://github.com/AliSoftware/OHHTTPStubs/pull/129.diff","patch_url":"https://github.com/AliSoftware/OHHTTPStubs/pull/129.patch"},"body":"iOS 4 allowed using `NSURL`s instead of `NSString`s for file paths. This PR allows using `NSURL`s to create `OHHTPStubResponse`s, which provides better compatibility with test code already using `NSURL`s.\r\n\r\nI copied each test using `responseWithFileAtPath:statusCode:headers:` and used `responseWithURL:statusCode:headers:` there instead. This ends up duplicating a lot of code, but I know some people prefer that for tests, and this seemed in line with the existing tests.\r\n\r\nAn alternate implementation of this PR could be to implement the `NSURL` methods in terms of `NSString` based file paths, or vice versa."},"comment":{"url":"https://api.github.com/repos/AliSoftware/OHHTTPStubs/issues/comments/148860472","html_url":"https://github.com/AliSoftware/OHHTTPStubs/pull/129#issuecomment-148860472","issue_url":"https://api.github.com/repos/AliSoftware/OHHTTPStubs/issues/129","id":148860472,"user":{"login":"AliSoftware","id":216089,"avatar_url":"https://avatars.githubusercontent.com/u/216089?v=3","gravatar_id":"","url":"https://api.github.com/users/AliSoftware","html_url":"https://github.com/AliSoftware","followers_url":"https://api.github.com/users/AliSoftware/followers","following_url":"https://api.github.com/users/AliSoftware/following{/other_user}","gists_url":"https://api.github.com/users/AliSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/AliSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AliSoftware/subscriptions","organizations_url":"https://api.github.com/users/AliSoftware/orgs","repos_url":"https://api.github.com/users/AliSoftware/repos","events_url":"https://api.github.com/users/AliSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/AliSoftware/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T22:57:36Z","updated_at":"2015-10-16T22:57:36Z","body":"> An alternate implementation of this PR could be to implement the NSURL methods in terms of NSString based file paths, or vice versa.\r\n\r\nAh, good point. Maybe we should then change the implementation of the methods using NSString so they now create an  `[NSURL URLWithFileAtPath:]` and call you implementation instead, to avoid code duplication in those implementation?"}}