Default task for namespace in Rake

前端 未结 8 1534
醉酒成梦
醉酒成梦 2020-12-12 23:05

Given something like:

namespace :my_tasks do
  task :foo do
    do_something
  end

  task :bar do
    do_something_else
  end

  task :all => [:foo, :bar         


        
8条回答
  •  误落风尘
    2020-12-12 23:55

    I use this Rakefile for cucumber:

    require 'cucumber'
    require 'cucumber/rake/task'
    
    namespace :features do
      Cucumber::Rake::Task.new(:fast) do |t|
        t.profile = 'fast'
      end
    
      Cucumber::Rake::Task.new(:slow) do |t|
        t.profile = 'slow'
      end
    
      task :ci => [:fast, :slow]
    end
    
    task :default => "features:ci"
    

    Then if I type just:

    rake
    

    It runs the default task, which runs both fast and slow tests.

    I learned this from Cheezy's blog.

提交回复
热议问题