{"action":"created","issue":{"url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/217","labels_url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/217/labels{/name}","comments_url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/217/comments","events_url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/217/events","html_url":"https://github.com/unexpectedjs/unexpected/issues/217","id":109708174,"number":217,"title":"Document 'when called with' and consider beefing it up","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":2,"created_at":"2015-10-04T22:14:18Z","updated_at":"2015-10-05T05:19:03Z","closed_at":null,"body":"```\r\nMunter 00:06\r\nIs there an expect(fn, 'when called [with]', [args], 'to return', ...)?\r\nThis is my case: https://github.com/Munter/pipetteur/blob/master/test/hex.js#L28\r\npapandreou 00:08\r\n@Munter It's just expect(fn, 'when called with', [args], 'to equal', expectedReturnValue);\r\nMunter 00:10\r\nSeems like that one might be missing from the docs\r\npapandreou 00:10\r\nI'd like to make the all those middle-of-the-rocket assertions more flexible so the next assertion is optional.\r\nOh, damn\r\nI'd like both of these to work:\r\nexpect(fn, 'called with', [args], 'to equal', ...);\r\nexpect(fn, 'called with', [args]).then(function (returnValue) { ... });\r\nI don't know if the \"when\" should be in there.\r\nMunter 00:13\r\nwith could be optional, allowing for no args\r\n```"},"comment":{"url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/comments/145432918","html_url":"https://github.com/unexpectedjs/unexpected/issues/217#issuecomment-145432918","issue_url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/217","id":145432918,"user":{"login":"sunesimonsen","id":90802,"avatar_url":"https://avatars.githubusercontent.com/u/90802?v=3","gravatar_id":"","url":"https://api.github.com/users/sunesimonsen","html_url":"https://github.com/sunesimonsen","followers_url":"https://api.github.com/users/sunesimonsen/followers","following_url":"https://api.github.com/users/sunesimonsen/following{/other_user}","gists_url":"https://api.github.com/users/sunesimonsen/gists{/gist_id}","starred_url":"https://api.github.com/users/sunesimonsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunesimonsen/subscriptions","organizations_url":"https://api.github.com/users/sunesimonsen/orgs","repos_url":"https://api.github.com/users/sunesimonsen/repos","events_url":"https://api.github.com/users/sunesimonsen/events{/privacy}","received_events_url":"https://api.github.com/users/sunesimonsen/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T05:19:03Z","updated_at":"2015-10-05T05:19:03Z","body":"@Munter I stumbled upon this as well. It is just kind of hard to solve."}}