From 802bb695c41c328e7da42807b9e6411015260c74 Mon Sep 17 00:00:00 2001 From: paulczar Date: Sun, 5 Jan 2014 15:07:15 -0600 Subject: [PATCH] example of using new chefspec coverage report about: https://sethvargo.com/chef-recipe-code-coverage/ output: https://gist.github.com/paulczar/6f9c6ddad71ef4cd6394 Change-Id: I77c32f13c85d26516ded961063412682665de4cb --- .gitignore | 2 +- Gemfile | 2 +- spec/spec_helper.rb | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 89e55045..3aa81a40 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ cookbooks/ .cookbooks .vagrant *.swp - +.coverage/ diff --git a/Gemfile b/Gemfile index 612085bd..a42e8e3d 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "https://rubygems.org" gem "chef", "~> 11.4.4" gem "json", "<= 1.7.7" # chef dependency gem "berkshelf", "~> 2.0.10" -gem "chefspec", "~> 3.0.2" +gem "chefspec", "~> 3.1.0" gem "foodcritic", "~> 3.0.3" gem "strainer" gem "webmock", "~> 1.11.0" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 96dc099e..6d0297ea 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -74,3 +74,5 @@ def neutron_stubs stub_command("ip link show eth1").and_return(false) end + +at_exit { ChefSpec::Coverage.report! }