Permalink
Browse files

Use simple_cov on 1.9 for code coverage analysis

  • Loading branch information...
1 parent e87142f commit a69b47d80bec1b2ee1651b7f5e07cf299f2fc2b3 @colszowka colszowka committed Aug 17, 2010
Showing with 20 additions and 0 deletions.
  1. +5 −0 Gemfile
  2. +5 −0 Gemfile.lock
  3. +10 −0 test/helper.rb
View
5 Gemfile
@@ -8,4 +8,9 @@ group :development do
gem "hpricot", ">= 0.8.0"
gem "rack-test", ">= 0.5.0"
gem 'jeweler', ">= 1.4.0"
+
+ if "1.9".respond_to?(:encoding)
+ gem "simple_cov", ">= 0.1.2"
+ gem "simple_cov-html", ">= 0.1.1"
+ end
end
View
5 Gemfile.lock
@@ -18,6 +18,9 @@ GEM
rubyforge (2.0.4)
json_pure (>= 1.1.7)
shoulda (2.10.3)
+ simple_cov (0.1.2)
+ simple_cov-html (0.1.1)
+ simple_cov (>= 0.0.2)
sinatra (1.0)
rack (>= 1.0)
stupid_formatter (0.2.0)
@@ -33,5 +36,7 @@ DEPENDENCIES
jeweler (>= 1.4.0)
rack-test (>= 0.5.0)
shoulda (= 2.10.3)
+ simple_cov (>= 0.1.2)
+ simple_cov-html (>= 0.1.1)
sinatra (>= 1.0.0)
stupid_formatter (>= 0.2.0)
View
10 test/helper.rb
@@ -2,6 +2,16 @@
require 'rubygems'
require 'bundler'
Bundler.setup(:default, :development)
+if "1.9".respond_to?(:encoding)
+ require 'simple_cov'
+ require 'simple_cov-html'
+ SimpleCov.start do
+ add_filter do |src_file|
+ !(src_file.filename =~ /^#{Dir.getwd}/)
+ end
+ end
+end
+
require 'test/unit'
require 'shoulda'
require 'rack/test'

0 comments on commit a69b47d

Please sign in to comment.