OSDN Git Service

add chefspec coverage report setting to the berkshelf-api-server-ya cookbook.
authorwhitestar <whitestar@gaea.test>
Sat, 17 Oct 2015 15:33:51 +0000 (00:33 +0900)
committerwhitestar <whitestar@gaea.test>
Sat, 17 Oct 2015 15:33:51 +0000 (00:33 +0900)
cookbooks/berkshelf-api-server-ya/spec/spec_helper.rb

index 480cfe4..715c876 100644 (file)
@@ -24,6 +24,20 @@ require 'chefspec'
 require 'chefspec/berkshelf'
 
 RSpec.configure do |config|
+  config.before(:suite) do
+    ChefSpec::Coverage.start! do
+      filters.clear
+
+      # custom filters
+      add_filter do |resource|
+        resource.name !~ %r{^(
+            /etc/sv/berks-api/run
+           |/etc/nginx/sites-available/berks-api
+          )$}x
+      end
+    end
+  end
+
   # Specify the path for Chef Solo to find cookbooks
   #config.cookbook_path = '/var/cookbooks'
 
@@ -42,3 +56,4 @@ RSpec.configure do |config|
   # Specify the operating version to mock Ohai data from
   # config.version = '12.04'
 end
+