Sha256: 243544754fd830aabe294de6806068d184cc3682a7376bea35ea5a2aefe4dc64
Contents?: true
Size: 1.81 KB
Versions: 3
Compression:
Stored size: 1.81 KB
Contents
require 'rake' require 'rake/rdoctask' require 'rake/testtask' require 'spec/rake/spectask' plugin_root = File.expand_path(File.dirname(__FILE__)) task :default => :spec task :stats => "spec:statsetup" desc "Run all specs in spec directory" Spec::Rake::SpecTask.new(:spec) do |t| t.spec_opts = ['--options', "\"#{plugin_root}/spec/spec.opts\""] t.spec_files = FileList['spec/**/*_spec.rb'] end namespace :spec do desc "Run all specs in spec directory with RCov" Spec::Rake::SpecTask.new(:rcov) do |t| t.spec_opts = ['--options', "\"#{plugin_root}/spec/spec.opts\""] t.spec_files = FileList['spec/**/*_spec.rb'] t.rcov = true t.rcov_opts = ['--exclude', 'spec', '--rails'] end desc "Print Specdoc for all specs" Spec::Rake::SpecTask.new(:doc) do |t| t.spec_opts = ["--format", "specdoc", "--dry-run"] t.spec_files = FileList['spec/**/*_spec.rb'] end [:models, :controllers, :views, :helpers].each do |sub| desc "Run the specs under spec/#{sub}" Spec::Rake::SpecTask.new(sub) do |t| t.spec_opts = ['--options', "\"#{plugin_root}/spec/spec.opts\""] t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"] end end namespace :db do namespace :fixtures do desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y" task :load => :environment do require 'active_record/fixtures' ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym) (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file| Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*')) end end end end end #Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
Version data entries
3 entries across 3 versions & 1 rubygems