Fixed rcov exclude options.
[arvados.git] / tasks / spec.rake
index 0c1fe59e0f9d72afadd4b29c9bc28851184fb20f..b83d31692293121a189b1c03f6bbc4c0e36e01d0 100644 (file)
@@ -5,14 +5,25 @@ namespace :spec do
     t.spec_files = FileList['spec/**/*_spec.rb']
     t.spec_opts = ['--require', 'rubygems', '--color', '--format', 'specdoc']
     if RCOV_ENABLED
+      if `which rcov`.strip == ""
+        STDERR.puts(
+          "Please install rcov and ensure that its binary is in the PATH:"
+        )
+        STDERR.puts("sudo gem install rcov")
+        exit(1)
+      end
       t.rcov = true
     else
       t.rcov = false
     end
     t.rcov_opts = [
+      '--exclude', 'lib\\/compat',
       '--exclude', 'spec',
+      '--exclude', '\\.rvm\\/gems',
       '--exclude', '1\\.8\\/gems',
-      '--exclude', '1\\.9\\/gems'
+      '--exclude', '1\\.9\\/gems',
+      '--exclude', '\\.rvm',
+      '--exclude', '\\/Library\\/Ruby',
     ]
   end