Skip to content

Commit

Permalink
script/generate cucumber sets up 'cucumber:ok' and 'cucumber:wip' tas…
Browse files Browse the repository at this point in the history
…ks and deprecates 'features'. More Kanban love. [cucumber#344 state:resolved]
  • Loading branch information
aslakhellesoy committed Aug 5, 2009
1 parent ba5d1fa commit 07e2ed7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions History.txt
@@ -1,6 +1,7 @@
== (In Git)

=== New features
* script/generate cucumber sets up 'cucumber:ok' and 'cucumber:wip' tasks and deprecates 'features'. More Kanban love. (#344 Aslak Hellesøy)
* Added examples/python that uses rubypython. (Aslak Hellesøy)
* Document builtin formatters with --help. (#406 Aslak Hellesøy)

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -6,4 +6,4 @@ Dir['gem_tasks/**/*.rake'].each { |rake| load rake }

# Hoe gives us :default => :test, but we don't have Test::Unit tests.
Rake::Task[:default].clear_prerequisites rescue nil # For some super weird reason this fails for some...
task :default => [:spec, :features]
task :default => [:spec, :cucumber]
4 changes: 2 additions & 2 deletions cucumber.yml
@@ -1,2 +1,2 @@
default: --format progress --tags ~@proposed,~@in-progress features
wip: --tags @in-progress --wip features
default: --format progress --tags ~@proposed,~@wip --strict features
wip: --tags @wip --wip features
6 changes: 3 additions & 3 deletions lib/cucumber/rake/task.rb
Expand Up @@ -8,8 +8,8 @@ module Rake
#
# Cucumber::Rake::Task.new
#
# This will create a task named 'features' described as 'Run Features with
# Cucumber'. It will use steps from 'features/**/*.rb' and features in 'features/**/*.feature'.
# This will create a task named 'cucumber' described as 'Run Cucumber features'.
# It will use steps from 'features/**/*.rb' and features in 'features/**/*.feature'.
#
# To further configure the task, you can pass a block:
#
Expand Down Expand Up @@ -148,7 +148,7 @@ def profile=(profile) #:nodoc:
end

# Define Cucumber Rake task
def initialize(task_name = "features", desc = "Run Features with Cucumber")
def initialize(task_name = "cucumber", desc = "Run Cucumber features")
@task_name, @desc = task_name, desc
@fork = true
@libs = ['lib']
Expand Down
24 changes: 18 additions & 6 deletions rails_generators/cucumber/templates/cucumber.rake
Expand Up @@ -4,15 +4,27 @@ unless ARGV.any? {|a| a =~ /^gems/}

begin
require 'cucumber/rake/task'
namespace :cucumber do
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass (no @wip tag)') do |t|
t.fork = true # You may get faster startup if you set this to false
t.cucumber_opts = "--tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}<%= spork? ? ' --drb' : '' %>"
end

Cucumber::Rake::Task.new(:features) do |t|
t.fork = true
t.cucumber_opts = [<%= options[:spork] ? "'--drb', " : "" %>'--format', (ENV['CUCUMBER_FORMAT'] || 'pretty')]
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run @wip features (not passing yet)') do |t|
t.fork = true # You may get faster startup if you set this to false
t.cucumber_opts = "--tags @wip --wip --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}<%= spork? ? ' --drb' : '' %>"
end

desc 'Run all features'
task :all => [:ok, :wip]
end

task :features => 'cucumber:ok' do
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
end
task :features => 'db:test:prepare'
rescue LoadError
desc 'Cucumber rake task not available'
task :features do
desc 'cucumber rake task not available (cucumber not installed)'
task :cucumber do
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
end
end
Expand Down

0 comments on commit 07e2ed7

Please sign in to comment.