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 collapse
- 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
-
#exclude_pattern ⇒ void
Files matching this pattern will be excluded.
-
#fail_on_error ⇒ void
Whether or not to fail Rake when an error occurs (typically when examples fail).
-
#failure_message ⇒ void
A message to print to stderr when there are failures.
-
#name ⇒ void
Name of task.
-
#pattern ⇒ void
Files matching this pattern will be loaded.
-
#rspec_opts ⇒ void
Command line options to pass to RSpec.
-
#rspec_path ⇒ void
Path to RSpec.
-
#ruby_opts ⇒ void
Command line options to pass to ruby.
-
#verbose ⇒ void
Use verbose output.
Instance Method Summary collapse
-
#initialize(*args, &task_block) ⇒ RakeTask
constructor
A new instance of RakeTask.
Constructor Details
#initialize(*args, &task_block) ⇒ RakeTask
Returns a new instance of RakeTask.
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/rspec/core/rake_task.rb', line 62 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
#exclude_pattern ⇒ void
Files matching this pattern will be excluded.
Defaults to nil
.
39 40 41 |
# File 'lib/rspec/core/rake_task.rb', line 39 def exclude_pattern @exclude_pattern end |
#fail_on_error ⇒ void
Whether or not to fail Rake when an error occurs (typically when
examples fail). Defaults to true
.
43 44 45 |
# File 'lib/rspec/core/rake_task.rb', line 43 def fail_on_error @fail_on_error end |
#failure_message ⇒ void
A message to print to stderr when there are failures.
46 47 48 |
# File 'lib/rspec/core/rake_task.rb', line 46 def @failure_message end |
#name ⇒ void
Name of task. Defaults to :spec
.
31 32 33 |
# File 'lib/rspec/core/rake_task.rb', line 31 def name @name end |
#pattern ⇒ void
Files matching this pattern will be loaded.
Defaults to 'spec/**{,/*/**}/*_spec.rb'
.
35 36 37 |
# File 'lib/rspec/core/rake_task.rb', line 35 def pattern @pattern end |
#rspec_opts ⇒ void
Command line options to pass to RSpec. Defaults to nil
.
60 61 62 |
# File 'lib/rspec/core/rake_task.rb', line 60 def rspec_opts @rspec_opts end |
#rspec_path ⇒ void
Path to RSpec. Defaults to the absolute path to the rspec binary from the loaded rspec-core gem.
57 58 59 |
# File 'lib/rspec/core/rake_task.rb', line 57 def rspec_path @rspec_path end |
#ruby_opts ⇒ void
Command line options to pass to ruby. Defaults to nil
.
53 54 55 |
# File 'lib/rspec/core/rake_task.rb', line 53 def ruby_opts @ruby_opts end |
#verbose ⇒ void
Use verbose output. If this is set to true, the task will print the
executed spec command to stdout. Defaults to true
.
50 51 52 |
# File 'lib/rspec/core/rake_task.rb', line 50 def verbose @verbose end |