-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for BehaviorSpec sample #562
Comments
And can only be used at the given scope. |
The problem to do it in the
But maybe this is users' choice? |
If you want to go crazy why not. |
To improve BehaviorSpec customizability, this commit adds extra scopes to BehaviorSpec. As discussed, users can concatenate `And` indefinitely, but it's ok. As `And` is optional to complete a test. This behavior is also observed in `FreeSpec`, as it can concatenate infinite test scopes too. To do that, every context (Given, And/When and Then) receive a new possibility of scoping, `And`. There are some variations of it, to build tests correctly: GivenAndContext, WhenAndContext and ThenAndContext. All of these are optional to use. Fixes #562
To improve BehaviorSpec customizability, this commit adds extra scopes to BehaviorSpec. As discussed, users can concatenate `And` indefinitely, but it's ok. As `And` is optional to complete a test. This behavior is also observed in `FreeSpec`, as it can concatenate infinite test scopes too. To do that, every context (Given, And/When and Then) receive a new possibility of scoping, `And`. There are some variations of it, to build tests correctly: GivenAndContext, WhenAndContext and ThenAndContext. All of these are optional to use. Fixes #562
@JustinTullgren |
To improve BehaviorSpec customizability, this commit adds extra scopes to BehaviorSpec. As discussed, users can concatenate `And` indefinitely, but it's ok. As `And` is optional to complete a test. This behavior is also observed in `FreeSpec`, as it can concatenate infinite test scopes too. To do that, Given and And/When contexts received a new possibility of scoping, `And`. There are some variations of it, to build tests correctly: GivenAndContext and WhenAndContext. All of these are optional to use. Fixes #562
To improve BehaviorSpec customizability, this commit adds extra scopes to BehaviorSpec. As discussed, users can concatenate `And` indefinitely, but it's ok. As `And` is optional to complete a test. This behavior is also observed in `FreeSpec`, as it can concatenate infinite test scopes too. To do that, Given and And/When contexts received a new possibility of scoping, `And`. There are some variations of it, to build tests correctly: GivenAndContext and WhenAndContext. All of these are optional to use. Fixes #562
@Kerooker fast turnaround! That works just fine thanks! |
It might get released soonish. |
Hi,
Version: "io.kotlintest:kotlintest-runner-junit5:3.1.11"
Kotlin Version: 1.3.11
I am curious how to use the
And
syntax with a BehaviorSpec.When trying to do this the receiver context can't be determined:
Unit can't be called in this context by implicit receiver. Use explicit context if necessary
.Adding the context
this@given.and
does not resolve the issue and the test context is never executed.I couldn't find a concrete example.
Thanks!
The text was updated successfully, but these errors were encountered: