How can I specify test environment for specific Spock test other than default one?
How can I specify test environment for specific Spock test other than default one?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As you can use the spock framework via command like (http://grails.org/plugin/spock, see Running Tests section), like this:
you should be able to specify the environment as well, pretty much like this:
because the test-app script allows environment option.
Let me know if this works for you. 🙂
EDIT:
As you noticed me, the solution above applies for every test in your application. In order to annotate every single test for a specific environment, I think you should have a look at this plugin:
http://www.grails.org/plugin/spock-grails-env-extensions