Class: RSpec::Core::RakeTask

Inherits:
Rake::TaskLib
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/rspec/core/rake_task.rb

Overview

Rspec rake task

See Also:

Constant Summary

DEFAULT_RSPEC_PATH =

Default path to the rspec executable

File.expand_path('../../../../exe/rspec', __FILE__)
DEFAULT_PATTERN =

Default pattern for spec files.

'./spec{,/*/**}/*_spec.rb'

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (RakeTask) initialize(*args, &task_block)



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/rspec/core/rake_task.rb', line 65

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

Instance Attribute Details

- (void) fail_on_error

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

default: true



35
36
37
# File 'lib/rspec/core/rake_task.rb', line 35

def fail_on_error
  @fail_on_error
end

- (void) failure_message

A message to print to stderr when there are failures.



38
39
40
# File 'lib/rspec/core/rake_task.rb', line 38

def failure_message
  @failure_message
end

- (void) name

Name of task.

default: :spec



23
24
25
# File 'lib/rspec/core/rake_task.rb', line 23

def name
  @name
end

- (void) pattern

Glob pattern to match files.

default: 'spec/*/_spec.rb'



29
30
31
# File 'lib/rspec/core/rake_task.rb', line 29

def pattern
  @pattern
end

- (void) rspec_opts

Command line options to pass to rspec.

default: nil



63
64
65
# File 'lib/rspec/core/rake_task.rb', line 63

def rspec_opts
  @rspec_opts
end

- (void) rspec_path

Path to rspec

default: 'rspec'



57
58
59
# File 'lib/rspec/core/rake_task.rb', line 57

def rspec_path
  @rspec_path
end

- (void) ruby_opts

Command line options to pass to ruby.

default: nil



51
52
53
# File 'lib/rspec/core/rake_task.rb', line 51

def ruby_opts
  @ruby_opts
end

- (void) verbose

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

default: true



45
46
47
# File 'lib/rspec/core/rake_task.rb', line 45

def verbose
  @verbose
end