2010-06-23 14:29:51 -04:00
|
|
|
require 'rubygems'
|
2010-12-13 17:28:59 -05:00
|
|
|
require 'bundler/setup'
|
2007-03-14 14:20:37 -04:00
|
|
|
require 'rake'
|
|
|
|
require 'rake/rdoctask'
|
2008-09-14 11:12:39 -04:00
|
|
|
require 'rake/gempackagetask'
|
2010-12-13 17:28:59 -05:00
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
require 'cucumber/rake/task'
|
2009-01-09 00:43:32 -05:00
|
|
|
|
|
|
|
$LOAD_PATH.unshift("lib")
|
2010-06-23 14:29:51 -04:00
|
|
|
require 'shoulda/version'
|
2007-03-14 14:20:37 -04:00
|
|
|
|
2007-04-05 15:15:56 -04:00
|
|
|
Rake::RDocTask.new { |rdoc|
|
|
|
|
rdoc.rdoc_dir = 'doc'
|
2007-08-07 10:44:59 -04:00
|
|
|
rdoc.title = "Shoulda -- Making tests easy on the fingers and eyes"
|
2009-02-28 17:54:02 -05:00
|
|
|
rdoc.options << '--line-numbers'
|
2007-04-05 15:15:56 -04:00
|
|
|
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
2008-06-17 13:07:10 -04:00
|
|
|
rdoc.rdoc_files.include('README.rdoc', 'CONTRIBUTION_GUIDELINES.rdoc', 'lib/**/*.rb')
|
2007-04-05 15:15:56 -04:00
|
|
|
}
|
|
|
|
|
2010-12-13 17:28:59 -05:00
|
|
|
RSpec::Core::RakeTask.new do |t|
|
|
|
|
t.pattern = "spec/**/*_spec.rb"
|
|
|
|
end
|
|
|
|
|
2008-07-01 10:06:29 -04:00
|
|
|
desc "Run code-coverage analysis using rcov"
|
2010-12-13 17:28:59 -05:00
|
|
|
RSpec::Core::RakeTask.new(:coverage) do |t|
|
|
|
|
t.rcov = true
|
|
|
|
t.rcov_opts = %{--exclude osx\/objc,spec,gems\/ --failure-threshold 100}
|
|
|
|
t.pattern = "spec/**/*_spec.rb"
|
2008-07-01 10:06:29 -04:00
|
|
|
end
|
|
|
|
|
2010-06-11 14:54:06 -04:00
|
|
|
eval("$specification = begin; #{IO.read('shoulda.gemspec')}; end")
|
|
|
|
Rake::GemPackageTask.new $specification do |pkg|
|
2008-09-14 11:12:39 -04:00
|
|
|
pkg.need_tar = true
|
|
|
|
pkg.need_zip = true
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Clean files generated by rake tasks"
|
|
|
|
task :clobber => [:clobber_rdoc, :clobber_package]
|
2010-06-23 14:29:51 -04:00
|
|
|
|
2010-12-13 15:56:37 -05:00
|
|
|
Cucumber::Rake::Task.new do |t|
|
|
|
|
t.fork = true
|
|
|
|
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
|
|
|
|
t.profile = 'default'
|
2010-06-23 14:29:51 -04:00
|
|
|
end
|
|
|
|
|
2010-12-13 17:28:59 -05:00
|
|
|
desc 'Default: run specs and cucumber features'
|
|
|
|
task :default => [:spec, :cucumber]
|
2010-06-23 14:29:51 -04:00
|
|
|
|