thoughtbot--shoulda-matchers/Rakefile

57 lines
1.5 KiB
Ruby
Raw Normal View History

require 'rubygems'
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
begin
require 'cucumber/rake/task'
rescue LoadError
warn "couldn't load cucumber, skipping"
end
$LOAD_PATH.unshift("lib")
require 'shoulda/version'
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
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]
2010-12-13 20:56:37 +00:00
Cucumber::Rake::Task.new do |t|
t.fork = true
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
t.profile = 'default'
end
desc 'Default: run test and cucumber features for support versions'
2010-12-13 20:56:37 +00:00
task :default => [:test, :cucumber]