class RSpec::Core::Configuration
def add_setting(name, opts={})
Aliases its setter, getter, and predicate, to those for the
:alias => :other_setting
will return +true+ as long as the value is not +false+ or +nil+).
This sets the default value for the getter and the predicate (which
:default => "default value"
keys:
+add_setting+ takes an optional hash that supports the following
== Options
end
c.add_setting :use_transactional_examples, :alias => :use_transactional_fixtures
c.add_setting :use_transactional_fixtures, :default => true
RSpec.configure do |c|
settings that are domain specific. For example:
Intended for extension frameworks like rspec-rails, so they can add config
RSpec.configuration.foo?() # returns !!foo
RSpec.configuration.foo()
RSpec.configuration.foo=(value)
and a predicate:
Creates three methods on the configuration object, a setter, a getter,
RSpec.configuration.add_setting :foo
Use this to add custom settings to the RSpec.configuration object.
add_setting(:name, :alias => :other_setting)
add_setting(:name, :default => "default_value")
add_setting(:name)
:call-seq:
def add_setting(name, opts={}) self.class.add_setting(name, opts) end