thoughtbot--shoulda-matchers/Rakefile

48 lines
1.3 KiB
Ruby
Raw Normal View History

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
$LOAD_PATH.unshift("lib")
require 'shoulda'
load 'tasks/shoulda.rake'
# Test::Unit::UI::VERBOSE
2009-01-22 23:22:11 +00:00
test_files_pattern = 'test/{unit,functional,other,matchers}/**/*_test.rb'
Rake::TestTask.new do |t|
t.libs << 'lib' << 'test'
t.pattern = test_files_pattern
t.verbose = false
end
Rake::RDocTask.new { |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "Shoulda -- Making tests easy on the fingers and eyes"
rdoc.options << '--line-numbers'
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
2008-06-17 17:07:10 +00:00
rdoc.rdoc_files.include('README.rdoc', 'CONTRIBUTION_GUIDELINES.rdoc', 'lib/**/*.rb')
}
desc "Run code-coverage analysis using rcov"
task :coverage do
rm_rf "coverage"
files = Dir[test_files_pattern]
system "rcov --rails --sort coverage -Ilib #{files.join(' ')}"
end
desc 'Default: run tests for all supported versions of Rails'
task :default do
2010-06-22 18:55:59 +00:00
%w(2.3.8 3.0.0.beta4).each do |version|
system("RAILS_VERSION=#{version} rake -s test;")
end
end
eval("$specification = begin; #{IO.read('shoulda.gemspec')}; end")
Rake::GemPackageTask.new $specification do |pkg|
pkg.need_tar = true
pkg.need_zip = true
end
desc "Clean files generated by rake tasks"
task :clobber => [:clobber_rdoc, :clobber_package]