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
Add extra scopes for BehaviorSpec #593
Add extra scopes for BehaviorSpec #593
Conversation
32afbe5
to
99418c7
Compare
Added docs |
|
I was thinking about it. I think the correct TestType would be What I had to do there is that Perhaps there's another way? |
And what are the rules for TestType.TEST to not be nested inside another one? I know it's counterintuitive when you read it, but are there cases that it wouldn't work? |
As this is an intended feature from Gradle, could we add this anyways and mark it for fixing when gradle fixes its issue? |
In theory you can nest TEST inside TEST_AND_CONTAINER, but it's all broken in gradle and they haven't fixed it in over a year. I guess other features take priority, although I would have thought working test support would be high priority in build tool. At this rate they might not fix it until 2020 so we can't rely on it working any time soon. Anyway, just don't use TEST inside TEST, so remove 'and' from within 'then'. |
That's a bummer. |
Nvm, comments are very ugly. |
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
99418c7
to
462667c
Compare
Should be good to go. |
To improve BehaviorSpec customizability, this commit adds extra scopes to BehaviorSpec. As discussed, users can concatenate
And
indefinitely, but it's ok. AsAnd
is optional to complete a test. This behavior is also observed inFreeSpec
, 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