database_cleaner/Rakefile

41 lines
1.1 KiB
Text
Raw Permalink Normal View History

require "rubygems"
require "bundler"
Bundler.setup
2009-02-26 23:42:20 -05:00
require 'rake'
2012-07-08 06:51:27 -04:00
require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
2015-01-02 15:14:04 -05:00
2012-07-08 06:51:27 -04:00
spec.pattern = FileList['spec/**/*_spec.rb']
2009-02-26 23:42:20 -05:00
end
2012-07-08 06:51:27 -04:00
RSpec::Core::RakeTask.new(:rcov) do |spec|
spec.pattern = 'spec/**/*_spec.rb'
spec.rcov = true
2009-02-26 23:42:20 -05:00
end
begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)
rescue LoadError
puts "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
end
task :default => [:spec, :features]
desc "Cleans the project of any tmp file that should not be included in the gemspec."
task :clean do
["examples/config/database.yml", "examples/db/activerecord_one.db", "examples/db/activerecord_two.db", "examples/db/datamapper_default.db",
"examples/db/datamapper_one.db", "examples/db/datamapper_two.db"].each do |f|
FileUtils.rm_f(f)
end
2011-06-20 21:32:32 -04:00
%w[*.sqlite3 *.log #* *.swp *.swo].each do |pattern|
`find . -name "#{pattern}" -delete`
end
end
desc "Cleans the dir and builds the gem"
task :prep => [:clean, :gemspec, :build]