Skip simplecov if gem fails to load or NO_COVERAGE_TEST env is set.
authorTom Clegg <tom@curoverse.com>
Mon, 5 May 2014 02:02:08 +0000 (22:02 -0400)
committerTom Clegg <tom@curoverse.com>
Mon, 5 May 2014 02:02:08 +0000 (22:02 -0400)
apps/workbench/test/test_helper.rb
services/api/test/test_helper.rb

index ba6621b40d0ae6e4b19c8bdd1a906d6c61c1fb54..ea5cb0660ccdc35d1d69b44d426084766f862068 100644 (file)
@@ -1,6 +1,12 @@
 ENV["RAILS_ENV"] = "test"
-require 'simplecov'
-SimpleCov.start
+unless ENV["NO_COVERAGE_TEST"]
+  begin
+    require 'simplecov'
+    SimpleCov.start
+  rescue Exception => e
+    $stderr.puts "SimpleCov unavailable (#{e}). Proceeding without."
+  end
+end
 
 require File.expand_path('../../config/environment', __FILE__)
 require 'rails/test_help'
index ee4d4cc64742c90e8995bd378d6f52018fcffba4..faa1c648e6c89e704fa332ab025f0d1faabaa22b 100644 (file)
@@ -1,7 +1,11 @@
 ENV["RAILS_ENV"] = "test"
 unless ENV["NO_COVERAGE_TEST"]
-  require 'simplecov'
-  SimpleCov.start
+  begin
+    require 'simplecov'
+    SimpleCov.start
+  rescue Exception => e
+    $stderr.puts "SimpleCov unavailable (#{e}). Proceeding without."
+  end
 end
 
 require File.expand_path('../../config/environment', __FILE__)