{"action":"created","issue":{"url":"https://api.github.com/repos/kotlintest/kotlintest/issues/108","repository_url":"https://api.github.com/repos/kotlintest/kotlintest","labels_url":"https://api.github.com/repos/kotlintest/kotlintest/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/kotlintest/kotlintest/issues/108/comments","events_url":"https://api.github.com/repos/kotlintest/kotlintest/issues/108/events","html_url":"https://github.com/kotlintest/kotlintest/issues/108","id":183091848,"number":108,"title":"Support \"should...\" operators with property-based testing","user":{"login":"brescia123","id":1311352,"avatar_url":"https://avatars.githubusercontent.com/u/1311352?v=3","gravatar_id":"","url":"https://api.github.com/users/brescia123","html_url":"https://github.com/brescia123","followers_url":"https://api.github.com/users/brescia123/followers","following_url":"https://api.github.com/users/brescia123/following{/other_user}","gists_url":"https://api.github.com/users/brescia123/gists{/gist_id}","starred_url":"https://api.github.com/users/brescia123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brescia123/subscriptions","organizations_url":"https://api.github.com/users/brescia123/orgs","repos_url":"https://api.github.com/users/brescia123/repos","events_url":"https://api.github.com/users/brescia123/events{/privacy}","received_events_url":"https://api.github.com/users/brescia123/received_events","type":"User","site_admin":false},"labels":[{"id":293015598,"url":"https://api.github.com/repos/kotlintest/kotlintest/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/kotlintest/kotlintest/milestones/4","html_url":"https://github.com/kotlintest/kotlintest/milestones/2.0","labels_url":"https://api.github.com/repos/kotlintest/kotlintest/milestones/4/labels","id":1854867,"number":4,"title":"2.0","description":null,"creator":{"login":"helmbold","id":5079980,"avatar_url":"https://avatars.githubusercontent.com/u/5079980?v=3","gravatar_id":"","url":"https://api.github.com/users/helmbold","html_url":"https://github.com/helmbold","followers_url":"https://api.github.com/users/helmbold/followers","following_url":"https://api.github.com/users/helmbold/following{/other_user}","gists_url":"https://api.github.com/users/helmbold/gists{/gist_id}","starred_url":"https://api.github.com/users/helmbold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helmbold/subscriptions","organizations_url":"https://api.github.com/users/helmbold/orgs","repos_url":"https://api.github.com/users/helmbold/repos","events_url":"https://api.github.com/users/helmbold/events{/privacy}","received_events_url":"https://api.github.com/users/helmbold/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":26,"state":"open","created_at":"2016-06-29T11:24:29Z","updated_at":"2016-11-17T21:55:11Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-10-14T16:18:26Z","updated_at":"2016-11-17T22:04:51Z","closed_at":null,"body":"All the functions used to do property-based testing (forAll, forNone) accept as last parameters a function that should returns a Boolean to indicate whether the test passes or not. \nIn order to use shouldBe and similar operators you have to always return true within the mentioned above function.\nIt think there should be a better way to do that, maybe modifying the function to not require a Boolean as return type.\n"},"comment":{"url":"https://api.github.com/repos/kotlintest/kotlintest/issues/comments/261384549","html_url":"https://github.com/kotlintest/kotlintest/issues/108#issuecomment-261384549","issue_url":"https://api.github.com/repos/kotlintest/kotlintest/issues/108","id":261384549,"user":{"login":"sksamuel","id":743706,"avatar_url":"https://avatars.githubusercontent.com/u/743706?v=3","gravatar_id":"","url":"https://api.github.com/users/sksamuel","html_url":"https://github.com/sksamuel","followers_url":"https://api.github.com/users/sksamuel/followers","following_url":"https://api.github.com/users/sksamuel/following{/other_user}","gists_url":"https://api.github.com/users/sksamuel/gists{/gist_id}","starred_url":"https://api.github.com/users/sksamuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sksamuel/subscriptions","organizations_url":"https://api.github.com/users/sksamuel/orgs","repos_url":"https://api.github.com/users/sksamuel/repos","events_url":"https://api.github.com/users/sksamuel/events{/privacy}","received_events_url":"https://api.github.com/users/sksamuel/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T22:04:51Z","updated_at":"2016-11-17T22:04:51Z","body":"I guess the idea was that for property based testing you don't have to use an assertion, you just use a boolean function, ie, its testing a property/function. It could be changed to use an assertion, which will make things a touch more verbose.\r\n\r\ncurrent:\r\n\r\n```kotlin\r\n    \"startsWith\" {\r\n      forAll(Gen.string(), Gen.string(), { a, b ->\r\n        (a + b).startsWith(a)\r\n      })\r\n    }\r\n```\r\n\r\nalternative:\r\n\r\n```kotlin\r\n    \"startsWith\" {\r\n      forAll(Gen.string(), Gen.string(), { a, b ->\r\n        (a + b).startsWith(a) shouldBe true\r\n      })\r\n    }\r\n```\r\n\r\nWhat do you think @helmbold @brescia123 "}}
{"actor":{"display_login":"sksamuel"}}