In your rake file:
require 'rubygems' require 'cucumber' require 'cucumber/rake/task' cuke_task = Cucumber::Rake::Task.new(:features) do |t| t.cucumber_opts = "features --format pretty" end task :feature, :name, :times do |task,args| puts "Executing feature: #{args[:name]} #{args[:times]} times" cuke_task.cucumber_opts = "features/#{args[:name]}" args[:times].to_i.times { Rake::Task[:features].execute } end
First I create a default oculation task that will perform all my functions and format them for me.
After that, I define a rake command called feature , which will take two parameters of the function name and execution times .
Then I increment the cuke task to use the name function that I specified, and then completed the Rake task with the number of times indicated.
$ rake feature['login.feature',500]
burtlo
source share