From 9007f9c8511241d350161876d11499ddab78237d Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Wed, 16 Jan 2013 22:15:45 -0600 Subject: [PATCH 1/5] Remove the coverage rake task RCov does not work on Ruby 1.9.x --- Rakefile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Rakefile b/Rakefile index 257da617..9504dc1d 100644 --- a/Rakefile +++ b/Rakefile @@ -55,14 +55,6 @@ Rake::TestTask.new(:test) do |test| test.verbose = true end -desc "Generate RCov test coverage and open in your browser" -task :coverage do - require 'rcov' - sh "rm -fr coverage" - sh "rcov test/test_*.rb" - sh "open coverage/index.html" -end - require 'rdoc/task' Rake::RDocTask.new do |rdoc| rdoc.rdoc_dir = 'rdoc' From 06a6b8aadbc0e63be0de2f7470e9eea3534c2aa0 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Wed, 16 Jan 2013 22:18:10 -0600 Subject: [PATCH 2/5] Add simplecov as a dependency Simplecov works with Ruby 1.9.x for generating test coverage --- jekyll.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/jekyll.gemspec b/jekyll.gemspec index 86df546b..ea593886 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -41,6 +41,7 @@ Gem::Specification.new do |s| s.add_development_dependency('rdiscount', "~> 1.6") s.add_development_dependency('redcarpet', "~> 2.1.1") s.add_development_dependency('launchy', "~> 2.1.2") + s.add_development_dependency('simplecov', "~> 0.7") # = MANIFEST = s.files = %w[ From 00d74fa53fe8ad3d6481457d4a64485a71c9fa06 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Wed, 16 Jan 2013 22:20:34 -0600 Subject: [PATCH 3/5] Add SimpleCov to the unit tests --- test/helper.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/helper.rb b/test/helper.rb index 491a41c7..c757e736 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,3 +1,6 @@ +require 'simplecov' +SimpleCov.start + require 'rubygems' gem 'RedCloth', '>= 4.2.1' From 79fceedab3ac20d9c01b0eb0f553e259eb7ec903 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Wed, 16 Jan 2013 22:22:33 -0600 Subject: [PATCH 4/5] add the coverage directory to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9c7a17eb..1bc95092 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ _site/ bbin/ gh-pages/ site/_site/ +coverage From 5e08cddb98cadbc78586633dbe16cea3ae9a7da9 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Wed, 16 Jan 2013 22:27:23 -0600 Subject: [PATCH 5/5] filter out test files in coverage results --- test/helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/helper.rb b/test/helper.rb index c757e736..69a4cbe5 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,5 +1,7 @@ require 'simplecov' -SimpleCov.start +SimpleCov.start do + add_filter "/test/" +end require 'rubygems' gem 'RedCloth', '>= 4.2.1'