Skip to content

Commit

Permalink
add coverage task using SimpleCov
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Lang committed Nov 27, 2011
1 parent e65bc22 commit d2ae1cd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ Session.vim
.*.swp
*~
.test-result
/coverage
7 changes: 6 additions & 1 deletion Rakefile
Expand Up @@ -8,14 +8,19 @@ task "default" => "quick-test"

desc "Run unit tests."
task "test" do
sh "ruby -I lib -I . test/suite.rb"
sh "ruby -I lib test/suite.rb"
end

desc "Quick test run."
task "quick-test" do
sh "ruby -I lib -I . test/test_unicode_utils.rb"
end

desc "Run tests and generate coverage report."
task "coverage" do
sh "ruby -I lib test/coverage.rb"
end

desc "Build unicode_utils gem."
task "gem" do
sh "gem build unicode_utils.gemspec"
Expand Down
4 changes: 4 additions & 0 deletions test/coverage.rb
@@ -0,0 +1,4 @@
require "simplecov"
SimpleCov.start

require_relative "suite.rb"
4 changes: 2 additions & 2 deletions test/suite.rb
@@ -1,3 +1,3 @@
Dir[File.dirname(__FILE__) + "/**/test_*.rb"].each { |fn|
require fn
Dir["#{File.dirname __FILE__}/test_*.rb"].each { |fn|
require_relative File.basename(fn)
}

0 comments on commit d2ae1cd

Please sign in to comment.