{"action":"created","issue":{"url":"https://api.github.com/repos/unexpectedjs/unexpected-sinon/issues/29","labels_url":"https://api.github.com/repos/unexpectedjs/unexpected-sinon/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/unexpectedjs/unexpected-sinon/issues/29/comments","events_url":"https://api.github.com/repos/unexpectedjs/unexpected-sinon/issues/29/events","html_url":"https://github.com/unexpectedjs/unexpected-sinon/pull/29","id":128155246,"number":29,"title":"Implemented new semantics for the 'was called with' assertion.","user":{"login":"papandreou","id":373545,"avatar_url":"https://avatars.githubusercontent.com/u/373545?v=3","gravatar_id":"","url":"https://api.github.com/users/papandreou","html_url":"https://github.com/papandreou","followers_url":"https://api.github.com/users/papandreou/followers","following_url":"https://api.github.com/users/papandreou/following{/other_user}","gists_url":"https://api.github.com/users/papandreou/gists{/gist_id}","starred_url":"https://api.github.com/users/papandreou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/papandreou/subscriptions","organizations_url":"https://api.github.com/users/papandreou/orgs","repos_url":"https://api.github.com/users/papandreou/repos","events_url":"https://api.github.com/users/papandreou/events{/privacy}","received_events_url":"https://api.github.com/users/papandreou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-01-22T13:20:06Z","updated_at":"2016-01-25T12:34:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/unexpectedjs/unexpected-sinon/pulls/29","html_url":"https://github.com/unexpectedjs/unexpected-sinon/pull/29","diff_url":"https://github.com/unexpectedjs/unexpected-sinon/pull/29.diff","patch_url":"https://github.com/unexpectedjs/unexpected-sinon/pull/29.patch"},"body":"* Require an array to be passed instead of supporting varargs. In my opinion that is much clearer. Also, it gets rid of this annoying edge zero params case: `expect(spy, 'was called with');`\r\n\r\n* Removed the 'exactly' flag -- always require an exact match. Since expect.it is supported, there are better ways of asserting only on a prefix of the argument list. If it turns out there's a clear enough use case, we can consider implementing a `was called with initial`, or we can add support for `<spy> was [always] called with <object>` so you can specify exactly which arguments via numerical properties.\r\n\r\nThis is, of course, a very breaking change, but I think we should rip off the band-aid and do a major version bump. Most test suites that rely on the old convention will be caught by the type system."},"comment":{"url":"https://api.github.com/repos/unexpectedjs/unexpected-sinon/issues/comments/174492439","html_url":"https://github.com/unexpectedjs/unexpected-sinon/pull/29#issuecomment-174492439","issue_url":"https://api.github.com/repos/unexpectedjs/unexpected-sinon/issues/29","id":174492439,"user":{"login":"papandreou","id":373545,"avatar_url":"https://avatars.githubusercontent.com/u/373545?v=3","gravatar_id":"","url":"https://api.github.com/users/papandreou","html_url":"https://github.com/papandreou","followers_url":"https://api.github.com/users/papandreou/followers","following_url":"https://api.github.com/users/papandreou/following{/other_user}","gists_url":"https://api.github.com/users/papandreou/gists{/gist_id}","starred_url":"https://api.github.com/users/papandreou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/papandreou/subscriptions","organizations_url":"https://api.github.com/users/papandreou/orgs","repos_url":"https://api.github.com/users/papandreou/repos","events_url":"https://api.github.com/users/papandreou/events{/privacy}","received_events_url":"https://api.github.com/users/papandreou/received_events","type":"User","site_admin":false},"created_at":"2016-01-25T12:34:39Z","updated_at":"2016-01-25T12:34:39Z","body":"@bruderstein Thanks for the thorough response. You're nowhere near bikeshedding in my book. I really want us to get this right!\r\n\r\nI think you're right about the confusion and irritation if we change the existing `was called with` to require an array. Let's take that off the table. I've also noted that I seem to be the one in this conversation that dislikes varargs, so I'm withdrawing that as well, except for when the assertion has `arguments satisfying` in its name so that users will naturally assume that they have to pass an array or an object with the spec.\r\n\r\nI agree about `to have a call satisfying`. It's more explicit than `to have call satisfying` and harder to type by accident. Since we can easily introduce that in a minor release, let's branch that discussion out. I implemented what seems to be the consensus here, including @sunesimonsen's ideas: https://github.com/unexpectedjs/unexpected-sinon/pull/31\r\n\r\nAs for `was called with` we still need to work out:\r\n\r\n1) whether to deprecate or maybe even remove it\r\n2) if it stays, whether to force the `always` mode to remove the element of surprise\r\n3) if it stays, how to cope with the fact that it uses `to satisfy` semantics for the individual arguments without advertising it in the assertion name\r\n\r\nMy vote is on 1)"}}