summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2014-04-26 21:22:30 -0400
committerAustin Ziegler <austin@zieglers.ca>2017-01-11 12:33:21 -0500
commit32727d6d0beb48672a1ee2d4a5c20bb81f7e301d (patch)
treea897f76448d18d81223567404c5df35846e65845
parentff796c262db5a22f14b4765c09655b4faccc132a (diff)
downloaddiff-lcs-32727d6d0beb48672a1ee2d4a5c20bb81f7e301d.tar.gz
Fixing Coveralls for testing.
-rw-r--r--README.rdoc6
-rw-r--r--Rakefile2
-rw-r--r--spec/spec_helper.rb48
3 files changed, 24 insertions, 32 deletions
diff --git a/README.rdoc b/README.rdoc
index b895c8f..fecf267 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -4,6 +4,8 @@ home :: https://github.com/halostatue/diff-lcs
code :: https://github.com/halostatue/diff-lcs
bugs :: https://github.com/halostatue/diff-lcs/issues
rdoc :: http://rubydoc.info/github/halostatue/diff-lcs
+continuous integration :: {<img src="https://travis-ci.org/halostatue/diff-lcs.png" />}[https://travis-ci.org/halostatue/diff-lcs]
+test coverage :: {<img src="https://coveralls.io/repos/halostatue/diff-lcs/badge.png" alt="Coverage Status" />}[https://coveralls.io/r/halostatue/diff-lcs]
== Description
@@ -76,10 +78,6 @@ Mario I. Wolczko's {Smalltalk version 1.2}[ftp://st.cs.uiuc.edu/pub/Smalltalk/MA
This library is called Diff::LCS because of an early version of Algorithm::Diff
which was restrictively licensed.
-== Continuous Integration Status
-
-{<img src="https://travis-ci.org/halostatue/diff-lcs.png" />}[https://travis-ci.org/halostatue/diff-lcs]
-
:include: Contributing.rdoc
:include: License.rdoc
diff --git a/Rakefile b/Rakefile
index 20f236d..478ac32 100644
--- a/Rakefile
+++ b/Rakefile
@@ -46,7 +46,7 @@ if RUBY_VERSION >= '1.9'
namespace :spec do
desc "Submit test coverage to Coveralls"
task :coveralls do
- ENV['COVERAGE'] = ENV['COVERALLS'] = 'yes'
+ ENV['COVERALLS'] = 'yes'
end
desc "Runs test coverage. Only works Ruby 1.9+ and assumes 'simplecov' is installed."
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 23d9a86..48bec6f 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -4,39 +4,33 @@ require 'rubygems'
require 'pathname'
require 'psych'
-if ENV['COVERAGE']
+if ENV['COVERALLS']
+ require 'coveralls'
+ Coveralls.wear!
+elsif ENV['COVERAGE']
require 'simplecov'
- if ENV['COVERALLS']
- require 'coveralls'
- formatters = Coveralls::SimpleCov::Formatter
- else
- def try_require(resource, &block)
- require resource
- block.call
- rescue LoadError
- nil
- end
-
- formatters = [ SimpleCov::Formatter::HTMLFormatter ]
+ def require_do(resource, &block)
+ require resource
+ block.call
+ rescue LoadError
+ nil
+ end
- try_require('simplecov-rcov') { formatters << SimpleCov::Formatter::RcovFormatter }
- try_require('simplecov-vim/formatter') {
- formatters << SimpleCov::Formatter::VimFormatter
- }
- try_require('simplecov-sublime-ruby-coverage') {
- formatters << SimpleCov::Formatter::SublimeRubyCoverageFormatter
- }
+ formatters = [ SimpleCov::Formatter::HTMLFormatter ]
- formatters = if formatters.size == 1
- formatters.first
- else
- SimpleCov::Formatter::MultiFormatter[*formatters]
- end
- end
+ require_do('simplecov-rcov') {
+ formatters << SimpleCov::Formatter::RcovFormatter
+ }
+ require_do('simplecov-vim/formatter') {
+ formatters << SimpleCov::Formatter::VimFormatter
+ }
+ require_do('simplecov-sublime-ruby-coverage') {
+ formatters << SimpleCov::Formatter::SublimeRubyCoverageFormatter
+ }
SimpleCov.start do
- formatter formatters
+ formatter SimpleCov::Formatter::MultiFormatter[*formatters]
end
end