Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Specs] Use Coveralls

  • Loading branch information...
commit c802cc97cb8b19b4e128ea5b1455fff5680a9a41 1 parent 361bec9
@fabiopelosin fabiopelosin authored
View
3  .gitignore
@@ -13,4 +13,5 @@ doc
tmp
.DS_Store
xcuserdata
-rakelib/doc
+rakelib/doccoverage/
+coverage/
View
1  Gemfile
@@ -3,6 +3,7 @@ source "http://rubygems.org"
gemspec
group :development do
+ gem 'coveralls', :require => false
gem "rake"
gem "mocha"
gem "bacon"
View
20 Gemfile.lock
@@ -13,23 +13,38 @@ GEM
multi_json (~> 1.0)
bacon (1.2.0)
colored (1.2)
+ colorize (0.5.8)
+ coveralls (0.6.2)
+ colorize
+ multi_json (~> 1.3)
+ rest-client
+ simplecov (>= 0.7)
+ thor
github-markup (0.7.5)
i18n (0.6.4)
kicker (2.6.1)
listen
listen (0.7.3)
metaclass (0.0.1)
- mocha (0.13.2)
+ mime-types (1.21)
+ mocha (0.13.3)
metaclass (~> 0.0.1)
mocha-on-bacon (0.2.2)
mocha (>= 0.13.0)
- multi_json (1.6.1)
+ multi_json (1.7.0)
posix-spawn (0.3.6)
pygments.rb (0.4.2)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rake (10.0.3)
redcarpet (2.2.2)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ simplecov (0.7.1)
+ multi_json (~> 1.0)
+ simplecov-html (~> 0.7.1)
+ simplecov-html (0.7.1)
+ thor (0.17.0)
yajl-ruby (1.1.0)
yard (0.8.5.2)
@@ -38,6 +53,7 @@ PLATFORMS
DEPENDENCIES
bacon
+ coveralls
github-markup
kicker
mocha
View
1  Rakefile
@@ -124,6 +124,7 @@ end
namespace :spec do
desc "Run all specs"
task :all => "ext:cleanbuild" do
+ ENV['GENERATE_COVERAGE'] = 'true'
sh "bundle exec bacon #{FileList['spec/**/*_spec.rb'].join(' ')}"
end
View
20 spec/spec_helper.rb
@@ -1,3 +1,23 @@
+# Set up coverage analysis
+#-----------------------------------------------------------------------------#
+
+if ENV['CI'] || ENV['GENERATE_COVERAGE']
+ require 'simplecov'
+ require 'coveralls'
+
+ if ENV['CI']
+ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
+ elsif ENV['GENERATE_COVERAGE']
+ SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
+ end
+ SimpleCov.start do
+ add_filter "/spec_helper/"
+ end
+end
+
+# Set up
+#-----------------------------------------------------------------------------#
+
require 'rubygems'
require 'bacon'
require 'mocha-on-bacon'
Please sign in to comment.
Something went wrong with that request. Please try again.