OSDN Git Service

upgrade to cucumber-0.5.3
[mint/mint-server.git] / lib / tasks / cucumber.rake
1 # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2 # It is recommended to regenerate this file in the future when you upgrade to a 
3 # newer version of cucumber-rails. Consider adding your own code to a new file 
4 # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5 # files.
6
7
8 unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
9
10 vendored_cucumber_bin = Dir["#{RAILS_ROOT}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
11 $LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
12
13 begin
14   require 'cucumber/rake/task'
15
16   namespace :cucumber do
17     Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
18       t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
19       t.fork = true # You may get faster startup if you set this to false
20       t.profile = 'default'
21     end
22
23     Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
24       t.binary = vendored_cucumber_bin
25       t.fork = true # You may get faster startup if you set this to false
26       t.profile = 'wip'
27     end
28
29     desc 'Run all features'
30     task :all => [:ok, :wip]
31   end
32   desc 'Alias for cucumber:ok'
33   task :cucumber => 'cucumber:ok'
34
35   task :default => :cucumber
36
37   task :features => :cucumber do
38     STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
39   end
40 rescue LoadError
41   desc 'cucumber rake task not available (cucumber not installed)'
42   task :cucumber do
43     abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
44   end
45 end
46
47 end