Class: RSpec::Core::ConfigurationOptions
- Inherits:
-
Object
- Object
- RSpec::Core::ConfigurationOptions
- Defined in:
- lib/rspec/core/configuration_options.rb
Overview
Responsible for utilizing externally provided configuration options,
whether via the command line, .rspec
, ~/.rspec
, .rspec-local
or a custom options file.
Constant Summary
Instance Attribute Summary (collapse)
-
- (Hash) options
readonly
The final merged options, drawn from all external sources.
Instance Method Summary (collapse)
-
- (void) configure(config)
Updates the provided Configuration instance based on the provided external configuration options.
-
- (void) configure_filter_manager(filter_manager)
private
Updates the provided FilterManager based on the filter options.
-
- (ConfigurationOptions) initialize(args)
constructor
A new instance of ConfigurationOptions.
Constructor Details
- (ConfigurationOptions) initialize(args)
Returns a new instance of ConfigurationOptions
12 13 14 15 |
# File 'lib/rspec/core/configuration_options.rb', line 12 def initialize(args) @args = args.dup end |
Instance Attribute Details
- (Hash) options (readonly)
Returns the final merged options, drawn from all external sources
37 38 39 |
# File 'lib/rspec/core/configuration_options.rb', line 37 def @options end |
Instance Method Details
- (void) configure(config)
Updates the provided RSpec::Core::Configuration instance based on the provided external configuration options.
21 22 23 24 25 |
# File 'lib/rspec/core/configuration_options.rb', line 21 def configure(config) config configure_filter_manager config.filter_manager load_formatters_into config end |
- (void) configure_filter_manager(filter_manager)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Updates the provided FilterManager based on the filter options.
30 31 32 33 34 |
# File 'lib/rspec/core/configuration_options.rb', line 30 def configure_filter_manager(filter_manager) @filter_manager_options.each do |command, value| filter_manager.__send__ command, value end end |