Sha256: a8a7fefc2eec753b0ec1771a2e9250dd7e21484a4a953695e1a8d5fe9fa58d6a

Contents?: true

Size: 925 Bytes

Versions: 5

Compression:

Stored size: 925 Bytes

Contents

require 'rubygems'
require 'rake'
require 'rake/testtask'

PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))

LIB_DIRECTORIES = FileList.new do |fl|
  fl.include "#{PROJECT_ROOT}/lib"
  fl.include "#{PROJECT_ROOT}/test/lib/file_column/lib"
end

TEST_FILES = FileList.new do |fl|
  fl.include "#{PROJECT_ROOT}/test/**/test_*.rb"
  fl.exclude "#{PROJECT_ROOT}/test/test_helper.rb"
  fl.exclude "#{PROJECT_ROOT}/test/lib/**/*.rb"
end

Rake.application.remove_task :test

desc 'Run all tests'
Rake::TestTask.new(:test) do |t|
  t.libs = LIB_DIRECTORIES
  t.test_files = TEST_FILES
  t.verbose = true
end

desc "Build a code coverage report"
task :coverage do
  files = TEST_FILES.join(" ")
  sh "rcov -o coverage #{files} --exclude ^/Library/Ruby/,^init.rb --include lib/ --include-file ^lib/.*\\.rb"
end

namespace :coverage do
  task :clean do
    rm_r 'coverage' if File.directory?('coverage')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
avatar-0.0.2 tasks/testing.rake
avatar-0.0.4 tasks/testing.rake
avatar-0.0.1 tasks/testing.rake
avatar-0.0.3 tasks/testing.rake
avatar-0.0.5 tasks/testing.rake