When changing the protocol of from_environment and from_yaml such that they should always raise Nesta::Config::NotDefined if they are unable to return a configured value of a config setting, I'd introduced a bug. If any NESTA_ environment variables were set, or if the config.yml file didn't exist, from_yaml would return nil. This broke the behaviour of other methods that depended on it to return NotDefined.
Previously these methods returned nil, which encouraged them to be called one after the other in a boolean short-circuit style, leading to subtle bugs in the way config values that evaluated to false were handled. Raising an exception has also allowed needlessly complex conditional statements to be simplified.
The thinking here is that when calling Config.fetch you might expect that it'd raise KeyError (like Hash#fetch) does if the config setting you want isn't defined. So we do.
Works like Ruby's Hash#fetch method.
stub! -> stub mock -> double