task :pre_commit => [:clobber_sqlite, :migrate, :generate_rspec, :specs, :spec]

task :clobber_sqlite do
  rm_rf 'db/*.db'
end

task :generate_rspec do
  `ruby script/generate rspec --force`
  raise "Failed to generate rspec environment" if $? != 0
end

task :specs do
  command = "spec specs"
  puts `#{command}`
  raise "rspec_on_rails specs failed (stand in ~/vendor/rspec_on_rails and run '#{command}' to see details)" if $? != 0
end
  

# We have to make sure the rspec lib above gets loaded rather than the gem one (in case it's installed)
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../../../../lib'))
require 'spec/rake/spectask'

task :pre_commit => [:clobber_sqlite, :migrate, :generate_rspec, :spec, :specs]

task :clobber_sqlite do
  rm_rf 'db/*.db'
end

task :generate_rspec do
  `ruby script/generate rspec --force`
  raise "Failed to generate rspec environment" if $? != 0
end

desc "Run the specs for RSpec on Rails itself"
Spec::Rake::SpecTask.new(:specs) do |t|
  t.spec_files = FileList['specs/*_spec.rb']
end
  

Make sure we load the rspec above, not the gem
Make sure we load the rspec above, not the gem

git-svn-id: f1a1267e29db6ed751edc5bdb54cf7d87c16124a@852 410327ef-2207-0410-a325-f78bbcb22a5a
