{"action":"created","issue":{"url":"https://api.github.com/repos/kotlintest/kotlintest/issues/163","repository_url":"https://api.github.com/repos/kotlintest/kotlintest","labels_url":"https://api.github.com/repos/kotlintest/kotlintest/issues/163/labels{/name}","comments_url":"https://api.github.com/repos/kotlintest/kotlintest/issues/163/comments","events_url":"https://api.github.com/repos/kotlintest/kotlintest/issues/163/events","html_url":"https://github.com/kotlintest/kotlintest/issues/163","id":215582570,"number":163,"title":"Strange \"Behavior Spec\" behavior","user":{"login":"A-Zaiats","id":7427071,"avatar_url":"https://avatars1.githubusercontent.com/u/7427071?v=4","gravatar_id":"","url":"https://api.github.com/users/A-Zaiats","html_url":"https://github.com/A-Zaiats","followers_url":"https://api.github.com/users/A-Zaiats/followers","following_url":"https://api.github.com/users/A-Zaiats/following{/other_user}","gists_url":"https://api.github.com/users/A-Zaiats/gists{/gist_id}","starred_url":"https://api.github.com/users/A-Zaiats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/A-Zaiats/subscriptions","organizations_url":"https://api.github.com/users/A-Zaiats/orgs","repos_url":"https://api.github.com/users/A-Zaiats/repos","events_url":"https://api.github.com/users/A-Zaiats/events{/privacy}","received_events_url":"https://api.github.com/users/A-Zaiats/received_events","type":"User","site_admin":false},"labels":[{"id":293015596,"url":"https://api.github.com/repos/kotlintest/kotlintest/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/kotlintest/kotlintest/milestones/6","html_url":"https://github.com/kotlintest/kotlintest/milestone/6","labels_url":"https://api.github.com/repos/kotlintest/kotlintest/milestones/6/labels","id":2124579,"number":6,"title":"3.0","description":null,"creator":{"login":"sksamuel","id":743706,"avatar_url":"https://avatars3.githubusercontent.com/u/743706?v=4","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},"open_issues":9,"closed_issues":17,"state":"open","created_at":"2016-11-09T13:19:37Z","updated_at":"2018-03-24T02:12:47Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2017-03-20T23:10:21Z","updated_at":"2018-03-24T02:12:47Z","closed_at":"2018-03-24T02:12:47Z","author_association":"NONE","body":"Hello.\r\nI tried the last 2.0-SNAPSHOT of kotlinspec (built from [this commit](https://github.com/kotlintest/kotlintest/commit/752dddf0c3622f5b75a32035e31c30a372ae1aae)). I have next code:\r\n```kotlin\r\nclass Test : BehaviorSpec() {\r\n    init {\r\n\r\n        Given(\"test\") {\r\n\r\n            When(\"when 1\") {\r\n                println(\"when 1\")\r\n\r\n                Then(\"test 1\") {\r\n                    println(\"test 1\")\r\n                }\r\n                Then(\"test 2\") {\r\n                    println(\"test 2\")\r\n                }\r\n            }\r\n\r\n            When(\"when 2\") {\r\n                println(\"when 2\")\r\n\r\n                Then(\"test 3\") {\r\n                    println(\"test 3\")\r\n                }\r\n                Then(\"test 4\") {\r\n                    println(\"test 4\")\r\n                }\r\n            }\r\n        }\r\n\r\n    }\r\n}\r\n```\r\nAnd there are outputs:\r\n```\r\n\r\noneInstancePerTest = true     |     oneInstancePerTest = false\r\nwhen 1                        |     when 1\r\nwhen 2                        |     when 2\r\nwhen 1                        |     test 1\r\nwhen 2                        |     test 2\r\ntest 1                        |     test 3\r\nwhen 1                        |     test 4\r\nwhen 2 \r\ntest 2 \r\nwhen 1\r\nwhen 2\r\ntest 3\r\nwhen 1\r\nwhen 2\r\ntest 4\r\n```\r\n\r\nMay I am wrong, but I think `when` block must be running separately just for inner `then` block:\r\n```\r\nwhen 1 -> test 1 -> test 2\r\nwhen 2 -> test 3 -> test 4\r\n```\r\nso I can write something like that:\r\n```\r\nGiven(a user try to login)\r\n\r\n    When(login was failed)  // mock request, configured via Mockito, returns error, valid for this `when` block\r\n        Then(show error for user)\r\n\r\n    When(login is success) // the same mock request returns success, valid for this `when` block\r\n        Then(store auth token)\r\n        Then(redirects user to main)\r\n```"},"comment":{"url":"https://api.github.com/repos/kotlintest/kotlintest/issues/comments/375839381","html_url":"https://github.com/kotlintest/kotlintest/issues/163#issuecomment-375839381","issue_url":"https://api.github.com/repos/kotlintest/kotlintest/issues/163","id":375839381,"user":{"login":"sksamuel","id":743706,"avatar_url":"https://avatars3.githubusercontent.com/u/743706?v=4","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":"2018-03-24T02:12:47Z","updated_at":"2018-03-24T02:12:47Z","author_association":"OWNER","body":"This is fixed in 3.0.0 RC1.\r\nIf you have the time, please give it a try. There are some breaking changes that should be aware of by reading the changelog here: https://github.com/kotlintest/kotlintest/blob/master/CHANGELOG.md"}}
{"actor":{"display_login":"sksamuel"}}