diff --git a/.gitignore b/.gitignore index 4040c6c..6ce29c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +coverage/ +coverage.data *.gem .bundle Gemfile.lock diff --git a/Rakefile b/Rakefile index 6139f72..eba7ddf 100644 --- a/Rakefile +++ b/Rakefile @@ -7,3 +7,19 @@ Rake::TestTask.new(:test) do |test| end task default: [:test] + +namespace :cover_me do + desc "Generates and opens code coverage report." + task :report do + require 'cover_me' + CoverMe.complete! + end +end + +task :test do + Rake::Task['cover_me:report'].invoke +end + +task :spec do + Rake::Task['cover_me:report'].invoke +end diff --git a/setler.gemspec b/setler.gemspec index 01413ca..7cb0ff7 100644 --- a/setler.gemspec +++ b/setler.gemspec @@ -21,4 +21,5 @@ Gem::Specification.new do |s| s.add_development_dependency('sqlite3') s.add_development_dependency('activerecord') s.add_development_dependency('rake') + s.add_development_dependency('cover_me') end diff --git a/test/test_helper.rb b/test/test_helper.rb index 1403df1..ff9dbc3 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,3 +1,4 @@ +require 'cover_me' require 'rubygems' require 'bundler'