-
Notifications
You must be signed in to change notification settings - Fork 179
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
Is there anything similar to JUnit Test Rule? #118
Comments
I don't think Spek has anything specific for this but you can make your own custom group functions which applies "rules". e.g.: inline fun Dsl.rxGroup(description: String, pending: Pending = Pending.No,
crossinline body: Dsl.() -> Unit) {
group(description, pending) {
beforeEach {
RxJavaPlugins.getInstance().reset()
RxJavaPlugins.getInstance().registerSchedulersHook(rxJavaSchedulersHook)}
}
body()
afterEach {
RxJavaPlugins.getInstance().reset()
}
}
} |
Thought so! Awesome tip! 👍 |
Another use case for #115 :) |
How would you achieve the same functionality as |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello Guys,
I wanted to be able to do something with the behavior similar to the JUnit test rule. Is that possible?
My goal would be to something like:
But without the need to repeat this code in each single test and somehow contain this logic on a separate piece of code.
Thank you
The text was updated successfully, but these errors were encountered: