Parent

Class Index [+]

Quicksearch

Cucumber::Rake::Task

Defines a Rake task for running features.

The simplest use of it goes something like:

  Cucumber::Rake::Task.new

This will define 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:

  Cucumber::Rake::Task.new do |t|
    t.cucumber_opts = %w{--format progress}
  end

This task can also be configured to be run with RCov:

  Cucumber::Rake::Task.new do |t|
    t.rcov = true
  end

See the attributes for additional configuration possibilities.

Attributes

libs[RW]

Directories to add to the Ruby $LOAD_PATH

binary[RW]

Name of the cucumber binary to use for running features. Defaults to Cucumber::BINARY

cucumber_opts[RW]

Extra options to pass to the cucumber binary. Can be overridden by the CUCUMBER_OPTS environment variable. It’s recommended to pass an Array, but if it’s a String it will be # by ’ ’.

rcov[RW]

Run cucumber with RCov? Defaults to false. If you set this to true, fork is implicit.

rcov_opts[RW]

Extra options to pass to rcov. It’s recommended to pass an Array, but if it’s a String it will be # by ’ ’.

fork[RW]

Whether or not to fork a new ruby interpreter. Defaults to true. You may gain some startup speed if you set it to false, but this may also cause issues with your load path and gems.

profile[RW]

Define what profile to be used. When used with cucumber_opts it is simply appended to it. Will be ignored when CUCUMBER_OPTS is used.

Public Class Methods

new(task_name = "cucumber", desc = "Run Cucumber features") click to toggle source

Define Cucumber Rake task

     # File lib/cucumber/rake/task.rb, line 125
125:       def initialize(task_name = "cucumber", desc = "Run Cucumber features")
126:         @task_name, @desc = task_name, desc
127:         @fork = true
128:         @libs = ['lib']
129:         @rcov_opts = %{--rails --exclude osx\/objc,gems\/}
130: 
131:         yield self if block_given?
132: 
133:         @binary = binary.nil? ? Cucumber::BINARY : File.expand_path(binary)
134:         @libs.insert(0, LIB) if binary == Cucumber::BINARY
135: 
136:         define_task
137:       end

Public Instance Methods

make_command_line_safe(list) click to toggle source
     # File lib/cucumber/rake/task.rb, line 165
165:       def make_command_line_safe(list)
166:         list.map{|string| string.gsub(' ', '\ ')}
167:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.