{"action":"created","issue":{"url":"https://api.github.com/repos/unexpectedjs/unexpected-check/issues/4","repository_url":"https://api.github.com/repos/unexpectedjs/unexpected-check","labels_url":"https://api.github.com/repos/unexpectedjs/unexpected-check/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/unexpectedjs/unexpected-check/issues/4/comments","events_url":"https://api.github.com/repos/unexpectedjs/unexpected-check/issues/4/events","html_url":"https://github.com/unexpectedjs/unexpected-check/pull/4","id":165983773,"number":4,"title":"Add 'when fuzzed by' helper 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,"assignees":[],"milestone":null,"comments":21,"created_at":"2016-07-17T16:26:14Z","updated_at":"2016-07-19T23:59:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/unexpectedjs/unexpected-check/pulls/4","html_url":"https://github.com/unexpectedjs/unexpected-check/pull/4","diff_url":"https://github.com/unexpectedjs/unexpected-check/pull/4.diff","patch_url":"https://github.com/unexpectedjs/unexpected-check/pull/4.patch"},"body":"I've found this more handy than `to be valid for all` in simple cases where there's a single input (subject) that has to be fuzzed and I don't need to change the default options. Let me know what you think :)"},"comment":{"url":"https://api.github.com/repos/unexpectedjs/unexpected-check/issues/comments/233801793","html_url":"https://github.com/unexpectedjs/unexpected-check/pull/4#issuecomment-233801793","issue_url":"https://api.github.com/repos/unexpectedjs/unexpected-check/issues/4","id":233801793,"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-07-19T23:59:37Z","updated_at":"2016-07-19T23:59:37Z","body":"Another idea that came up today:\r\n\r\n```js\r\nexpect.addAssertion('<chance-generator> [when] fuzzed <assertion>', function (expect, subject) {\r\n    expect.errorMode = 'nested';\r\n    return expect(function (value) {\r\n        return expect.shift(value);\r\n    }, 'to be valid for all', subject);\r\n});\r\n\r\nvar g = require('chance-generators')(666);\r\n\r\nfunction makePrefixGenerator(str) {\r\n    return g.integer({min: 1, max: str.length - 1}).map(function (prefixLength) {\r\n        return str.substr(0, prefixLength);\r\n    });\r\n}\r\n\r\nexpect(g.identity('abc').map(generatePrefixes), 'when fuzzed to match', /^a/);\r\n```"}}
{"actor":{"display_login":"papandreou"}}