Parent

Methods

Included Modules

Class/Module Index [+]

Quicksearch

RSpec::Core::RakeTask

Rspec rake task

@see Rakefile

Constants

DEFAULT_PATTERN

Default pattern for spec files.

DEFAULT_RSPEC_PATH

Default path to the rspec executable

Attributes

fail_on_error[RW]

Whether or not to fail Rake when an error occurs (typically when examples fail).

default:

true
failure_message[RW]

A message to print to stderr when there are failures.

name[RW]

Name of task.

default:

:spec
pattern[RW]

Glob pattern to match files.

default:

'spec/**/*_spec.rb'
rspec_opts[RW]

Command line options to pass to rspec.

default:

nil
rspec_path[RW]

Path to rspec

default:

'rspec'
ruby_opts[RW]

Command line options to pass to ruby.

default:

nil
verbose[RW]

Use verbose output. If this is set to true, the task will print the executed spec command to stdout.

default:

true

Public Class Methods

new(*args, &task_block) click to toggle source
# File lib/rspec/core/rake_task.rb, line 69
def initialize(*args, &task_block)
  @name          = args.shift || :spec
  @ruby_opts     = nil
  @rspec_opts    = nil
  @verbose       = true
  @fail_on_error = true
  @rspec_path    = DEFAULT_RSPEC_PATH
  @pattern       = DEFAULT_PATTERN

  define(args, &task_block)
end

Public Instance Methods

run_task(verbose) click to toggle source

@private

# File lib/rspec/core/rake_task.rb, line 82
def run_task(verbose)
  command = spec_command

  begin
    puts command if verbose
    success = system(command)
  rescue
    puts failure_message if failure_message
  end
  if fail_on_error && !success
    $stderr.puts "#{command} failed"
    exit $?.exitstatus
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.