Sha256: 59dedfc5c2de1b3e0ef28b51474b62c15accc71aa35debccadb848e0ad24ad89

Contents?: true

Size: 1.94 KB

Versions: 12

Compression:

Stored size: 1.94 KB

Contents

require 'rubygems'
require 'spec/rake/spectask'
require 'cucumber/rake/task'

desc "Run the specs under spec"
Spec::Rake::SpecTask.new do |t|
  t.spec_files = FileList['spec/**/*_spec.rb']
  t.spec_opts << "-c"
end
task :spec => :check_dependencies

desc "Run all feature-set configurations"
task :features do |t|
  databases = ENV['DATABASES'] || 'mysql,postgresql'
  databases.split(',').each do |database|
    puts   "rake features:#{database}"
    system "rake features:#{database}"
  end
end

namespace :features do
  def add_task(name, description)
    Cucumber::Rake::Task.new(name, description) do |t|
      t.cucumber_opts = "--format pretty features/*.feature DATABASE=#{name}"
    end
  end
  
  add_task :mysql,      "Run feature-set against MySQL"
  add_task :postgresql, "Run feature-set against PostgreSQL"
  
  task :mysql      => :check_dependencies
  task :postgresql => :check_dependencies
end

desc "Generate RCov reports"
Spec::Rake::SpecTask.new(:rcov) do |t|
  t.libs << 'lib'
  t.spec_files = FileList['spec/**/*_spec.rb']
  t.rcov = true
  t.rcov_opts = [
    '--exclude', 'spec',
    '--exclude', 'gems',
    '--exclude', 'riddle',
    '--exclude', 'ruby'
  ]
end

namespace :rcov do
  def add_task(name, description)
    Cucumber::Rake::Task.new(name, description) do |t|
      t.cucumber_opts = "--format pretty"
      t.profile = name
      t.rcov = true
      t.rcov_opts = [
        '--exclude', 'spec',
        '--exclude', 'gems',
        '--exclude', 'riddle',
        '--exclude', 'features'
      ]
    end
  end
  
  add_task :mysql,      "Run feature-set against MySQL with rcov"
  add_task :postgresql, "Run feature-set against PostgreSQL with rcov"
end

desc "Build cucumber.yml file"
task :cucumber_defaults do
  steps = FileList["features/step_definitions/**.rb"].collect { |path|
    "--require #{path}"
  }.join(" ")
  
  File.open('cucumber.yml', 'w') { |f|
    f.write "default: \"--require features/support/env.rb #{steps}\"\n"
  }
end

Version data entries

12 entries across 12 versions & 5 rubygems

Version Path
thorsson_thinking-sphinx-2.0 tasks/testing.rb
angelf-thinking-sphinx-1.3.18 tasks/testing.rb
thinking-sphinx-1.3.19 tasks/testing.rb
thorsson_thinking-sphinx-1.3.18 tasks/testing.rb
thinking-sphinx-allen-1.3.18.4 tasks/testing.rb
thinking-sphinx-allen-1.3.18.3 tasks/testing.rb
thinking-sphinx-allen-1.3.18.2 tasks/testing.rb
thinking-sphinx-allen-1.3.18.1 tasks/testing.rb
thinking-sphinx-allen-1.3.18 tasks/testing.rb
thinking-sphinx-1.3.18 tasks/testing.rb
josh_cutler-thinking-sphinx-1.3.17 tasks/testing.rb
thinking-sphinx-1.3.17 tasks/testing.rb