Class: Detroit::RSpec
- Inherits:
-
Tool
- Object
- Tool
- Detroit::RSpec
- Defined in:
- lib/detroit-rspec.rb
Overview
The RSpec tool is used to run project specifications written with RSpec. Specifications are expected to found in the standard ‘spec/` directory unless otherwise specified in the tools options.
Options:
specs File glob(s) of spec files. Defaults to ['spec/**/*_spec.rb', 'spec/**/spec_*.rb'].
loadpath Paths to add $LOAD_PATH. Defaults to ['lib'].
live Ignore loadpath, use installed libraries instead. Default is false.
require Lib(s) to require before excuting specifications.
warning Whether to show warnings or not. Default is false.
format Format of RSpec output.
extra Additional commandl ine options for spec command.
NOTE: This tool currently shells out to the command line.
– TODO: Use rspec options file?
TODO: RCOV suppot?
ruby [ruby_opts] -Ilib -S rcov [rcov_opts] bin/spec -- examples [spec_opts]
++
Instance Attribute Summary collapse
-
#extra ⇒ Object
Additional command line options for rspec.
-
#format ⇒ Object
Format of RSpec output.
-
#loadpath ⇒ Object
Paths to add $LOAD_PATH.
-
#requires ⇒ Object
Scripts to require before excuting specifications.
-
#specs ⇒ Object
File glob(s) of spec files.
-
#warning ⇒ Object
Whether to show warnings or not.
Class Method Summary collapse
Instance Method Summary collapse
-
#document ⇒ Object
Run all specs with documentation output.
-
#run ⇒ Object
(also: #test)
Run all specs.
-
#station_document ⇒ Object
Attach document method to document assembly station.
-
#station_test ⇒ Object
Attach test method to test assembly station.
Instance Attribute Details
#extra ⇒ Object
Additional command line options for rspec.
57 58 59 |
# File 'lib/detroit-rspec.rb', line 57 def extra @extra end |
#format ⇒ Object
Format of RSpec output.
54 55 56 |
# File 'lib/detroit-rspec.rb', line 54 def format @format end |
#loadpath ⇒ Object
Paths to add $LOAD_PATH. Defaults to [‘lib’].
42 43 44 |
# File 'lib/detroit-rspec.rb', line 42 def loadpath @loadpath end |
#requires ⇒ Object
Scripts to require before excuting specifications.
48 49 50 |
# File 'lib/detroit-rspec.rb', line 48 def requires @requires end |
#specs ⇒ Object
File glob(s) of spec files. Defaults to [‘spec/*/_spec.rb’, ‘spec/*/spec_.rb’].
36 37 38 |
# File 'lib/detroit-rspec.rb', line 36 def specs @specs end |
#warning ⇒ Object
Whether to show warnings or not. Default is false.
51 52 53 |
# File 'lib/detroit-rspec.rb', line 51 def warning @warning end |
Class Method Details
.man_page ⇒ Object
148 149 150 |
# File 'lib/detroit-rspec.rb', line 148 def self.man_page File.dirname(__FILE__)+'/../man/detroit-rspec.5' end |
Instance Method Details
#document ⇒ Object
Run all specs with documentation output.
86 87 88 |
# File 'lib/detroit-rspec.rb', line 86 def document run_specs('documentation') end |
#run ⇒ Object Also known as: test
Run all specs.
Returns false
if any tests failed, otherwise true
.
78 79 80 |
# File 'lib/detroit-rspec.rb', line 78 def run run_specs end |
#station_document ⇒ Object
Attach document method to document assembly station.
68 69 70 |
# File 'lib/detroit-rspec.rb', line 68 def station_document document end |
#station_test ⇒ Object
Attach test method to test assembly station.
63 64 65 |
# File 'lib/detroit-rspec.rb', line 63 def station_test test end |