{"action":"created","issue":{"url":"https://api.github.com/repos/JetBrains/spek/issues/219","repository_url":"https://api.github.com/repos/JetBrains/spek","labels_url":"https://api.github.com/repos/JetBrains/spek/issues/219/labels{/name}","comments_url":"https://api.github.com/repos/JetBrains/spek/issues/219/comments","events_url":"https://api.github.com/repos/JetBrains/spek/issues/219/events","html_url":"https://github.com/JetBrains/spek/issues/219","id":237251833,"number":219,"title":"Programmatically ignore/skip test","user":{"login":"thatJavaNerd","id":5074326,"avatar_url":"https://avatars3.githubusercontent.com/u/5074326?v=3","gravatar_id":"","url":"https://api.github.com/users/thatJavaNerd","html_url":"https://github.com/thatJavaNerd","followers_url":"https://api.github.com/users/thatJavaNerd/followers","following_url":"https://api.github.com/users/thatJavaNerd/following{/other_user}","gists_url":"https://api.github.com/users/thatJavaNerd/gists{/gist_id}","starred_url":"https://api.github.com/users/thatJavaNerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatJavaNerd/subscriptions","organizations_url":"https://api.github.com/users/thatJavaNerd/orgs","repos_url":"https://api.github.com/users/thatJavaNerd/repos","events_url":"https://api.github.com/users/thatJavaNerd/events{/privacy}","received_events_url":"https://api.github.com/users/thatJavaNerd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-06-20T15:27:25Z","updated_at":"2017-06-22T16:57:15Z","closed_at":null,"body":"Is there currently a way to ignore/skip tests programmatically? I saw #5, but I'm not sure if anything came out of it.\r\n\r\nIn TestNG we can simply throw a `SkipException` to skip a test. For JUnit 4, this [StackOverflow post](https://stackoverflow.com/a/1689309) seems to say that if an assumption failed, the test would be skipped. Maybe I'm doing something wrong, but this doesn't seem to be the case with Spek (or maybe in JUnit 5 as a whole)\r\n\r\n```kotlin\r\nclass SampleSpek : Spek({\r\n    describe(\"foo\") {\r\n        it(\"should be skipped\") {\r\n            assumeTrue(false)\r\n        }\r\n    }\r\n})\r\n```\r\n\r\n```\r\norg.junit.AssumptionViolatedException: got: <false>, expected: is <true>\r\n```"},"comment":{"url":"https://api.github.com/repos/JetBrains/spek/issues/comments/310440117","html_url":"https://github.com/JetBrains/spek/issues/219#issuecomment-310440117","issue_url":"https://api.github.com/repos/JetBrains/spek/issues/219","id":310440117,"user":{"login":"thatJavaNerd","id":5074326,"avatar_url":"https://avatars3.githubusercontent.com/u/5074326?v=3","gravatar_id":"","url":"https://api.github.com/users/thatJavaNerd","html_url":"https://github.com/thatJavaNerd","followers_url":"https://api.github.com/users/thatJavaNerd/followers","following_url":"https://api.github.com/users/thatJavaNerd/following{/other_user}","gists_url":"https://api.github.com/users/thatJavaNerd/gists{/gist_id}","starred_url":"https://api.github.com/users/thatJavaNerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatJavaNerd/subscriptions","organizations_url":"https://api.github.com/users/thatJavaNerd/orgs","repos_url":"https://api.github.com/users/thatJavaNerd/repos","events_url":"https://api.github.com/users/thatJavaNerd/events{/privacy}","received_events_url":"https://api.github.com/users/thatJavaNerd/received_events","type":"User","site_admin":false},"created_at":"2017-06-22T16:57:15Z","updated_at":"2017-06-22T16:57:15Z","body":"Thank you!\r\n\r\nI ended up using something similar to what @artem-zinnatullin suggested:\r\n\r\n```kotlin\r\nfun SpecBody.assume(check: () -> Boolean, description: String, body: TestBody.() -> Unit) {\r\n    if (check())\r\n        it(description, body)\r\n    else\r\n        xit(description, reason = \"assumption failed\", body = body)\r\n}\r\n```\r\n\r\nAre there any plans to include something like this in the API?"}}
{"actor":{"display_login":"thatJavaNerd"}}