<commit_before>raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec pkg]))
raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec-rails" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec-rails pkg]))

# In rails 1.2, plugins aren't available in the path until they're loaded.
# Check to see if the rspec plugin is installed first and require
# it if it is.  If not, use the gem version.
rspec_base = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec/lib')
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
begin
  require 'spec/rake/spectask'
  require 'cucumber/rake/task'

  spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
  task :noop do
  end

  task :default => :spec
  task :stats => "spec:statsetup"

  desc 'Run all specs in spec directory (excluding plugin & generator specs)'
  task :spec => spec_prereq do
    errors = %w(spec:integration spec:models spec:controllers spec:views spec:helpers spec:lib spec:generators spec:extensions).collect do |task|
      begin
        puts %{\nRunning #{task.gsub('spec:', '').titlecase} Spec Task}
        Rake::Task[task].invoke
        nil
      rescue => e
        task
      ensure
        if task == 'spec:integration'
          Rake::Task["db:test:load"].reenable
          Rake::Task["db:schema:load"].reenable
          Rake::Task["db:test:prepare"].execute
        end
      end
    end.compact
    abort "Errors running #{errors.to_sentence}!" if errors.any?
  end

  namespace :spec do
    desc "Run all specs in spec directory with RCov (excluding plugin & generator specs)"
    Spec::Rake::SpecTask.new(:rcov) do |t|
      t.spec_opts = ['--options', "\"#{RADIANT_ROOT}/spec/spec.opts\""]
      t.spec_files = FileList.new('spec/**/*_spec.rb') do |fl|
        fl.exclude(/generator/)
      end<commit_msg>Removing the integration tests from the spec task.<commit_after>raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec pkg]))
raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec-rails" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec-rails pkg]))

# In rails 1.2, plugins aren't available in the path until they're loaded.
# Check to see if the rspec plugin is installed first and require
# it if it is.  If not, use the gem version.
rspec_base = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec/lib')
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
begin
  require 'spec/rake/spectask'
  require 'cucumber/rake/task'

  spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
  task :noop do
  end

  task :default => :spec
  task :stats => "spec:statsetup"

  desc 'Run all specs in spec directory (excluding plugin & generator specs)'
  task :spec => spec_prereq do
    errors = %w(spec:models spec:controllers spec:views spec:helpers spec:lib spec:generators spec:extensions).collect do |task|
      begin
        puts %{\nRunning #{task.gsub('spec:', '').titlecase} Spec Task}
        Rake::Task[task].invoke
        nil
      rescue => e
        task
      ensure
        if task == 'spec:integration'
          Rake::Task["db:test:load"].reenable
          Rake::Task["db:schema:load"].reenable
          Rake::Task["db:test:prepare"].execute
        end
      end
    end.compact
    abort "Errors running #{errors.to_sentence}!" if errors.any?
  end

  namespace :spec do
    desc "Run all specs in spec directory with RCov (excluding plugin & generator specs)"
    Spec::Rake::SpecTask.new(:rcov) do |t|
      t.spec_opts = ['--options', "\"#{RADIANT_ROOT}/spec/spec.opts\""]
      t.spec_files = FileList.new('spec/**/*_spec.rb') do |fl|
        fl.exclude(/generator/)
      end
{'fraction_non_alphanumeric': 0.13831867057673508, 'fraction_numerical': 0.0009775171065493646, 'mean_word_length': 3.5077092511013217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3583874', 'n_tokens_mistral': 1333, 'n_tokens_neox': 1293, 'n_words': 369}