Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 81 lines (65 sloc) 2.081 kb
6531f28 @pat Neatening up public and dev rake tasks - influenced by a patch from Ryan...
pat authored
1 require 'rubygems'
e7e1e50 @pat Fixing up rake tasks to use bundled gem versions.
pat authored
2 require 'bundler'
3
b04a72c @pat Removing Jeweler and using Bundler, updated RSpec and Cucumber.
pat authored
4 Bundler::GemHelper.install_tasks
e7e1e50 @pat Fixing up rake tasks to use bundled gem versions.
pat authored
5 Bundler.require :default, :development
294bc74 @pat Making spec/feature paths a bit more explicit, so they're 1.9.2 friendly...
pat authored
6
b04a72c @pat Removing Jeweler and using Bundler, updated RSpec and Cucumber.
pat authored
7 require 'rspec/core/rake_task'
8 require 'cucumber/rake/task'
9
10 RSpec::Core::RakeTask.new
11
12 desc 'Run all feature-set configurations'
0ddb0fa @pat Don't have rake shelling out to rake - let's set this task hierarchy pro...
pat authored
13 task :cucumber => ['cucumber:mysql', 'cucumber:postgresql']
b04a72c @pat Removing Jeweler and using Bundler, updated RSpec and Cucumber.
pat authored
14
15 namespace :cucumber do
16 def add_task(name, description)
17 Cucumber::Rake::Task.new(name, description) do |t|
232e861 @pat JRuby fixes for test suite.
pat authored
18 t.cucumber_opts = "--format pretty DATABASE=#{name}"
b04a72c @pat Removing Jeweler and using Bundler, updated RSpec and Cucumber.
pat authored
19 end
20 end
21
22 add_task :mysql, 'Run feature-set against MySQL'
23 add_task :postgresql, 'Run feature-set against PostgreSQL'
24
25 desc 'Build cucumber.yml file'
26 task :defaults do
27 steps = FileList['features/step_definitions/**.rb'].collect { |path|
28 "--require #{path}"
29 }.join(" ")
30
31 File.open('cucumber.yml', 'w') { |f|
32 f.write "default: \"--require features/support/env.rb #{steps}\"\n"
33 }
34 end
35 end
36
37 namespace :rcov do
38 desc 'Generate RCov reports'
39 RSpec::Core::RakeTask.new(:rspec) do |t|
40 t.rcov = true
41 t.rcov_opts = [
42 '--exclude', 'spec',
43 '--exclude', 'gems',
44 '--exclude', 'riddle',
45 '--exclude', 'ruby',
46 '--aggregate coverage.data'
47 ]
48 end
49
50 def add_task(name, description)
51 Cucumber::Rake::Task.new(name, description) do |t|
52 t.cucumber_opts = "--format pretty features/*.feature DATABASE=#{name}"
53 t.rcov = true
54 t.rcov_opts = [
55 '--exclude', 'spec',
56 '--exclude', 'gems',
57 '--exclude', 'riddle',
58 '--exclude', 'features',
59 '--aggregate coverage.data'
60 ]
61 end
62 end
63
64 add_task :mysql, 'Run feature-set against MySQL with rcov'
65 add_task :postgresql, 'Run feature-set against PostgreSQL with rcov'
66
67 task :all do
68 rm 'coverage.data' if File.exist?('coverage.data')
69 rm 'rerun.txt' if File.exist?('rerun.txt')
70
71 Rake::Task['rcov:rspec'].invoke
72 Rake::Task['rcov:mysql'].invoke
73 Rake::Task['rcov:postgresql'].invoke
74 end
75 end if defined?(Rcov)
76
77 desc 'Generate documentation'
78 YARD::Rake::YardocTask.new
91f95d9 @pat Initial Travis setup.
pat authored
79
829bd4d @pat Adding cucumber to default test suite.
pat authored
80 task :default => [:spec, :cucumber]
Something went wrong with that request. Please try again.