Class: RSpec::Core::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- RSpec::Core::RakeTask
- Includes:
- Rake::DSL
- Defined in:
- lib/rspec/core/rake_task.rb
Overview
Rspec rake task
Constant Summary
- DEFAULT_RSPEC_PATH =
Default path to the rspec executable
File.('../../../../exe/rspec', __FILE__)
- DEFAULT_PATTERN =
Default pattern for spec files.
'./spec{,/*/**}/*_spec.rb'
Instance Attribute Summary (collapse)
-
- (void) fail_on_error
Whether or not to fail Rake when an error occurs (typically when examples fail).
-
- (void) failure_message
A message to print to stderr when there are failures.
-
- (void) name
Name of task.
-
- (void) pattern
Glob pattern to match files.
-
- (void) rspec_opts
Command line options to pass to rspec.
-
- (void) rspec_path
Path to rspec.
-
- (void) ruby_opts
Command line options to pass to ruby.
-
- (void) verbose
Use verbose output.
Instance Method Summary (collapse)
-
- (RakeTask) initialize(*args, &task_block)
constructor
A new instance of RakeTask.
Constructor Details
- (RakeTask) initialize(*args, &task_block)
Returns a new instance of RakeTask
69 70 71 72 73 74 75 76 77 78 79 |
# 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 |
Instance Attribute Details
- (void) fail_on_error
Whether or not to fail Rake when an error occurs (typically when examples fail).
default: true
39 40 41 |
# File 'lib/rspec/core/rake_task.rb', line 39 def fail_on_error @fail_on_error end |
- (void) failure_message
A message to print to stderr when there are failures.
42 43 44 |
# File 'lib/rspec/core/rake_task.rb', line 42 def @failure_message end |
- (void) name
Name of task.
default: :spec
27 28 29 |
# File 'lib/rspec/core/rake_task.rb', line 27 def name @name end |
- (void) pattern
Glob pattern to match files.
default: 'spec/*/_spec.rb'
33 34 35 |
# File 'lib/rspec/core/rake_task.rb', line 33 def pattern @pattern end |
- (void) rspec_opts
Command line options to pass to rspec.
default: nil
67 68 69 |
# File 'lib/rspec/core/rake_task.rb', line 67 def rspec_opts @rspec_opts end |
- (void) rspec_path
Path to rspec
default: 'rspec'
61 62 63 |
# File 'lib/rspec/core/rake_task.rb', line 61 def rspec_path @rspec_path end |
- (void) ruby_opts
Command line options to pass to ruby.
default: nil
55 56 57 |
# File 'lib/rspec/core/rake_task.rb', line 55 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
49 50 51 |
# File 'lib/rspec/core/rake_task.rb', line 49 def verbose @verbose end |