{"action":"created","issue":{"url":"https://api.github.com/repos/stretchr/testify/issues/208","labels_url":"https://api.github.com/repos/stretchr/testify/issues/208/labels{/name}","comments_url":"https://api.github.com/repos/stretchr/testify/issues/208/comments","events_url":"https://api.github.com/repos/stretchr/testify/issues/208/events","html_url":"https://github.com/stretchr/testify/pull/208","id":103497687,"number":208,"title":"Allows mock call expectations to be defined in arbitrary order","user":{"login":"tcsc","id":1959769,"avatar_url":"https://avatars.githubusercontent.com/u/1959769?v=3","gravatar_id":"","url":"https://api.github.com/users/tcsc","html_url":"https://github.com/tcsc","followers_url":"https://api.github.com/users/tcsc/followers","following_url":"https://api.github.com/users/tcsc/following{/other_user}","gists_url":"https://api.github.com/users/tcsc/gists{/gist_id}","starred_url":"https://api.github.com/users/tcsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcsc/subscriptions","organizations_url":"https://api.github.com/users/tcsc/orgs","repos_url":"https://api.github.com/users/tcsc/repos","events_url":"https://api.github.com/users/tcsc/events{/privacy}","received_events_url":"https://api.github.com/users/tcsc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-08-27T12:31:35Z","updated_at":"2015-09-11T20:06:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/stretchr/testify/pulls/208","html_url":"https://github.com/stretchr/testify/pull/208","diff_url":"https://github.com/stretchr/testify/pull/208.diff","patch_url":"https://github.com/stretchr/testify/pull/208.patch"},"body":"Originally the expctations required that the return values be specified immediately after the method name and arguments, otherwise the call setup will either panic (best case) or silently modify the *previous*\r\ncall specification (worst case).\r\n\r\nThis change moves the `Return()`, `Run()`, `Once()`, etc methods onto the `Call` struct, and changes the chaining behaviour so that they modify the `Call` data directly rather than referencing the last item in the `ExpectedCalls` array.\r\n\r\nThe major externally visible change is that the methods all now return a pointer to the `Call` they're operating on, rather than a pointer to the containing `Mock` instance. This would break any code that chains multiple call setups together, so I have added an `On` method to `Call` that passes the call setup through to the `Mock`. \r\n\r\nI've updated the tests to match, and added a few new ones to cover the new functionality."},"comment":{"url":"https://api.github.com/repos/stretchr/testify/issues/comments/139649307","html_url":"https://github.com/stretchr/testify/pull/208#issuecomment-139649307","issue_url":"https://api.github.com/repos/stretchr/testify/issues/208","id":139649307,"user":{"login":"DAddYE","id":6537,"avatar_url":"https://avatars.githubusercontent.com/u/6537?v=3","gravatar_id":"","url":"https://api.github.com/users/DAddYE","html_url":"https://github.com/DAddYE","followers_url":"https://api.github.com/users/DAddYE/followers","following_url":"https://api.github.com/users/DAddYE/following{/other_user}","gists_url":"https://api.github.com/users/DAddYE/gists{/gist_id}","starred_url":"https://api.github.com/users/DAddYE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DAddYE/subscriptions","organizations_url":"https://api.github.com/users/DAddYE/orgs","repos_url":"https://api.github.com/users/DAddYE/repos","events_url":"https://api.github.com/users/DAddYE/events{/privacy}","received_events_url":"https://api.github.com/users/DAddYE/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T20:06:06Z","updated_at":"2015-09-11T20:06:06Z","body":"Awesome job @tcsc I'll probably reuse this script when we will make more braking changes !!!\r\n\r\n:+1: from me!"}}