lib/mixlib/config.rb in mixlib-config-2.2.11 vs lib/mixlib/config.rb in mixlib-config-2.2.12

- old
+ new

@@ -156,9 +156,18 @@ configuration.has_key?(key.to_sym) || config_contexts.has_key?(key.to_sym) end alias_method :has_key?, :key? + def is_default?(key) + symbol = key.to_sym + if configurables.has_key?(symbol) + configurables[symbol].is_default?(configuration) + else + raise ArgumentError, "config option must exist, and not be a context to check for default values" + end + end + # Resets a config option to its default. # # === Parameters # symbol<Symbol>:: Name of the config option def delete(symbol)