A website template with lots of features, built with ruby on rails.

cucumber.rake 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
  7. vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
  8. $LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
  9. begin
  10. require 'cucumber/rake/task'
  11. namespace :cucumber do
  12. Cucumber::Rake::Task.new({:ok => 'test:prepare'}, 'Run features that should pass') do |t|
  13. t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
  14. t.fork = true # You may get faster startup if you set this to false
  15. t.profile = 'default'
  16. end
  17. Cucumber::Rake::Task.new({:wip => 'test:prepare'}, 'Run features that are being worked on') do |t|
  18. t.binary = vendored_cucumber_bin
  19. t.fork = true # You may get faster startup if you set this to false
  20. t.profile = 'wip'
  21. end
  22. Cucumber::Rake::Task.new({:rerun => 'test:prepare'}, 'Record failing features and run only them if any exist') do |t|
  23. t.binary = vendored_cucumber_bin
  24. t.fork = true # You may get faster startup if you set this to false
  25. t.profile = 'rerun'
  26. end
  27. desc 'Run all features'
  28. task :all => [:ok, :wip]
  29. task :statsetup do
  30. require 'rails/code_statistics'
  31. ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
  32. ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
  33. end
  34. end
  35. desc 'Alias for cucumber:ok'
  36. task :cucumber => 'cucumber:ok'
  37. task :default => :cucumber
  38. task :features => :cucumber do
  39. STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
  40. end
  41. # In case we don't have the generic Rails test:prepare hook, append a no-op task that we can depend upon.
  42. task 'test:prepare' do
  43. end
  44. task :stats => 'cucumber:statsetup'
  45. rescue LoadError
  46. desc 'cucumber rake task not available (cucumber not installed)'
  47. task :cucumber do
  48. abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
  49. end
  50. end
  51. end