简体   繁体   中英

Test groups in spock?

Is there anything like TestNG groups in spock? I want to be able to run from console only fast unit tests or database tests or integration tests or everything. And whenever I run database tests i want to run some setup and teardown before/after this specific group. how can i achieve it using spock?

You can use JUnit(4) suites for defining a set of tests to execute along with setup and teardown code. Filtering can also be done with JUnit categories and/or your build tool of choice. Depending on circumstances, it might be better to automate setup/teardown using the build tool.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM