summaryrefslogtreecommitdiffstats
path: root/rubygem-docile-1.1.3-simplecov.patch
blob: c8b9dbb932c90274fe3c3a88c631be8ce550d67d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
commit 0db1d3be2bcf2a14de40cca0dbcc777ee911700a
Author: Ken Dreyer <ktdreyer@ktdreyer.com>
Date:   Wed Jun 11 17:24:42 2014 -0600

    tests: make simplecov/coveralls optional
    
    If we do not have SimpleCov or Coveralls installed, we should be able to
    continue with the rest of the test suite.
    
    This allows the tests to run outside of Bundler if SimpleCov or
    Coveralls are not installed.

diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 4cd8c40..b5e20a2 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,16 +1,20 @@
 require 'rubygems'
 require 'rspec'
 require 'singleton'
-require 'simplecov'
-require 'coveralls'
+begin
+  require 'simplecov'
+  require 'coveralls'
 
-# Both local SimpleCov and publish to Coveralls.io
-SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
-  SimpleCov::Formatter::HTMLFormatter,
-  Coveralls::SimpleCov::Formatter
-]
-SimpleCov.start do
-  add_filter "/spec/"
+  # Both local SimpleCov and publish to Coveralls.io
+  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
+    SimpleCov::Formatter::HTMLFormatter,
+    Coveralls::SimpleCov::Formatter
+  ]
+  SimpleCov.start do
+    add_filter "/spec/"
+  end
+rescue LoadError
+  warn 'warning: simplecov/coveralls gems not found; skipping coverage'
 end
 
 test_dir = File.dirname(__FILE__)
@@ -25,4 +29,4 @@ RSpec.configure do |config|
   config.expect_with :rspec do |c|
     c.syntax = :expect
   end
-end
\ No newline at end of file
+end