{"action":"created","issue":{"url":"https://api.github.com/repos/net-a-porter-mobile/NSURLSession-Mock/issues/20","repository_url":"https://api.github.com/repos/net-a-porter-mobile/NSURLSession-Mock","labels_url":"https://api.github.com/repos/net-a-porter-mobile/NSURLSession-Mock/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/net-a-porter-mobile/NSURLSession-Mock/issues/20/comments","events_url":"https://api.github.com/repos/net-a-porter-mobile/NSURLSession-Mock/issues/20/events","html_url":"https://github.com/net-a-porter-mobile/NSURLSession-Mock/pull/20","id":142218441,"number":20,"title":"Custom mock response data based on regex URL matches","user":{"login":"deanWombourne","id":7887119,"avatar_url":"https://avatars.githubusercontent.com/u/7887119?v=3","gravatar_id":"","url":"https://api.github.com/users/deanWombourne","html_url":"https://github.com/deanWombourne","followers_url":"https://api.github.com/users/deanWombourne/followers","following_url":"https://api.github.com/users/deanWombourne/following{/other_user}","gists_url":"https://api.github.com/users/deanWombourne/gists{/gist_id}","starred_url":"https://api.github.com/users/deanWombourne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deanWombourne/subscriptions","organizations_url":"https://api.github.com/users/deanWombourne/orgs","repos_url":"https://api.github.com/users/deanWombourne/repos","events_url":"https://api.github.com/users/deanWombourne/events{/privacy}","received_events_url":"https://api.github.com/users/deanWombourne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-20T23:02:47Z","updated_at":"2016-03-22T22:27:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/net-a-porter-mobile/NSURLSession-Mock/pulls/20","html_url":"https://github.com/net-a-porter-mobile/NSURLSession-Mock/pull/20","diff_url":"https://github.com/net-a-porter-mobile/NSURLSession-Mock/pull/20.diff","patch_url":"https://github.com/net-a-porter-mobile/NSURLSession-Mock/pull/20.patch"},"body":"Hey. This should fix #4 :)\r\n\r\nThis should let mocks use the incoming URL to define their output body. The readme explains this better :)\r\n\r\nI've also made the MockResponse struct be created dynamically by a block instead of created when you call `mockEvery` - this should open us up to also allowing customisation of the headers and statusCodes, though I don't see a use case yet, so YAGNI :)\r\n\r\nI've preserved the original mock... methods parameter order out of politeness, but the two new methods I've added have the block at the end so we can use Swift's trailing block syntax. I don't know which we prefer, parameter order consistency or backwards compatibility. It's trivial either way - I happen ot have taken the safe option in this PR. I can change that if you want.\r\n\r\nS\r\n"},"comment":{"url":"https://api.github.com/repos/net-a-porter-mobile/NSURLSession-Mock/issues/comments/200061553","html_url":"https://github.com/net-a-porter-mobile/NSURLSession-Mock/pull/20#issuecomment-200061553","issue_url":"https://api.github.com/repos/net-a-porter-mobile/NSURLSession-Mock/issues/20","id":200061553,"user":{"login":"kerrmarin","id":2995710,"avatar_url":"https://avatars.githubusercontent.com/u/2995710?v=3","gravatar_id":"","url":"https://api.github.com/users/kerrmarin","html_url":"https://github.com/kerrmarin","followers_url":"https://api.github.com/users/kerrmarin/followers","following_url":"https://api.github.com/users/kerrmarin/following{/other_user}","gists_url":"https://api.github.com/users/kerrmarin/gists{/gist_id}","starred_url":"https://api.github.com/users/kerrmarin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kerrmarin/subscriptions","organizations_url":"https://api.github.com/users/kerrmarin/orgs","repos_url":"https://api.github.com/users/kerrmarin/repos","events_url":"https://api.github.com/users/kerrmarin/events{/privacy}","received_events_url":"https://api.github.com/users/kerrmarin/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T22:27:38Z","updated_at":"2016-03-22T22:27:38Z","body":"Awesome, if it builds, let's merge it!"}}