Class: RSpecTurbo::Options
- Inherits:
-
Object
- Object
- RSpecTurbo::Options
- Defined in:
- lib/rspec_turbo/options.rb
Overview
Splits the raw ARGV into RSpec options and target folders/files, and pulls out –exclude-pattern values for the file discovery step.
The tricky part is knowing which flags consume the next token as a value (so it is not mistaken for a folder); OPTIONS_WITH_VALUES lists those.
Constant Summary collapse
- OPTIONS_WITH_VALUES =
Set.new(%w[ --exclude-pattern --pattern --format --require --order --seed --tag --failure-exit-code --backtrace-exclusion-pattern ]).freeze
Instance Attribute Summary collapse
-
#exclude_patterns ⇒ Object
readonly
Returns the value of attribute exclude_patterns.
-
#folders ⇒ Object
readonly
Returns the value of attribute folders.
-
#rspec_options ⇒ Object
readonly
Returns the value of attribute rspec_options.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize(argv) ⇒ Options
Returns a new instance of Options.
17 18 19 20 |
# File 'lib/rspec_turbo/options.rb', line 17 def initialize(argv) @rspec_options, @folders = parse(argv) @exclude_patterns = extract_exclude_patterns(@rspec_options) end |
Instance Attribute Details
#exclude_patterns ⇒ Object (readonly)
Returns the value of attribute exclude_patterns.
15 16 17 |
# File 'lib/rspec_turbo/options.rb', line 15 def exclude_patterns @exclude_patterns end |
#folders ⇒ Object (readonly)
Returns the value of attribute folders.
15 16 17 |
# File 'lib/rspec_turbo/options.rb', line 15 def folders @folders end |
#rspec_options ⇒ Object (readonly)
Returns the value of attribute rspec_options.
15 16 17 |
# File 'lib/rspec_turbo/options.rb', line 15 def @rspec_options end |