I am writing a simple cookbook that will be used to deploy an SSL proxy onto a server. This cookbook will ultimately be used by other cookbooks that deploy web services in order to set up an SSL proxy in front of them, but for the purpose of testing the proxy cookbook itself, there is no such service behind it. My basic testing strategy for this cookbook is as follows:
So my question is, what is the right way to set up these sort of test preconditions using test-kitchen and ServerSpec and/or bats?
If the setup and teardown truly aren't part of what I'm testing, then I usually just do them in Ruby somewhere that runs before each test (often, in spec_helper.rb). Since serverspec is just literally running ruby code line by line on a test-kitchen instance, it doesn't feel necessary to me to have something in serverspec that offers setup/teardown functionality (in other words, there's no ordering issues or repeated tests that would require calling a setup or teardown method).