Skip to content
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 like @BeforeSpek or @AfterSpek #145

Closed
stoyicker opened this issue Dec 29, 2016 · 7 comments
Closed

Is there anything like @BeforeSpek or @AfterSpek #145

stoyicker opened this issue Dec 29, 2016 · 7 comments
Milestone

Comments

@stoyicker
Copy link

I've been reading #115 where this are mentions about statements for before and after group. The problem is that the intention with that one seems to be exposing an extension api. Will writing an extension be needed to add Spek-wide before/after statements?

@hhariri
Copy link
Contributor

hhariri commented Dec 30, 2016

No. This is already available. You can use onBefore/After Test

@stoyicker
Copy link
Author

I was after something that runs only once for the whole spek, not for every test

@hhariri
Copy link
Contributor

hhariri commented Dec 30, 2016 via email

@stoyicker
Copy link
Author

Alright thanks.

@raniejade
Copy link
Member

@stoyicker , in the 1.1 eap xxxEach were renamed to xxxEachTest to match the actual behaviour. We could add beforeEach and afterEach which will execute before and after a group, respectively. Since a spek is still a group, adding it at the top most level is essentially the same as BeforeSpek and AfterSpek.

@raniejade raniejade reopened this Jan 1, 2017
@stoyicker
Copy link
Author

I support the suggestion of adding wrappers to run around groups so that using them at top level would enclose the whole Spek - it's basically what I was after and I really believe that writing group-level initialization and teardown should be supported as is already the case for individual tests with xxxEachTest - although I'd like to take the chance and ask to please have them called more explicitly, something like beforeGroup and afterGroup. And thanks for listening!

@raniejade
Copy link
Member

+1 on beforeGroup and afterGroup. Going to include this in the next release (w/c will be sometime this week)

@raniejade raniejade added this to the 1.1 milestone Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants