ranjibif you can keep your own recipes and external recipes in different locations, you can use chefspec's filter to include only your recipes for coverage calculationhthOn Thu, Aug 20, 2015 at 9:32 AM, Sean OMeara < " target="_blank"> > wrote:ChefSpec just makes assertions about the compiled resource_collection.Since include_recipe compiles the requested recipes, rewriting the specs for those is redundant.This should be enoughUnfortunately, due to the way Chef works, you won't have %100 ChefSpec code coverage unless you go and restate yourself.As for package vs yum_package, that's a Chef version specific detail, that ChefSpec can't really do much about.-sOn Wed, Aug 19, 2015 at 8:09 PM, Yoshi Spendiff < " target="_blank"> > wrote:Why is this specifying yum_package instead of using the package resource and check? Can I make it not do this?When looking at the code coverage reports from ChefSpec they're saying there's a bunch of yum_package resources that are not being touched, which match up to the package resources in the other recipes. At no place do I actually use a yum_package resource.I also have a default recipe in this cookbook that includes some of the other recipes in the cookbook, including ones that have a package resource. In fact that's all that recipe does (include_recipe) so in my ChefSpec tests for that recipe I just check for the includes.I have ChefSpec tests for each of these individual recipes that check that the package resource is doing something. All is well.Hi,I have a cookbook that has a few recipes, so of them install packages using the package resource.
Archive powered by MHonArc 2.6.16.