" type="cite">3. If this is a cookbook that you intend to release to the community then I would write both unit and integration tests. It's a lot quicker to run a chefspec suite (especially if you use caching instead of let) than full integration tests, so you can run those while you're developing to quickly see if you've introduced a problem and then move up to integration tests once those passdefault['mycookbook']['service_port'] = 1234default['mycookbook']['service_name'] = 'myservice'1. Parameterise it if it's something that would need changing. If it's a service for something specific and that service usually has a well known name then don't parameterise it2. If you use parameters then set them as attributes in an attribute file in your cookbook, i.e.
On Mon, Jun 15, 2015 at 8:22 PM, Sean Farrow < " target="_blank"> > wrote:
Hi,
I am writing a recipe that cretes a windows service. Is it better to have a hard-coded service name or parameterize this in some way? I the latter, what method is better, databags or is ther something else?
Also should I write a unit test using ChefSpec for this or is just an integration test sufficient?
What are people’s testing preferences around uses of third-party cookbooks?
Kind regards
Sean.
--
Archive powered by MHonArc 2.6.16.