Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Settings::Container#reset!, set up inheritance relationship #323

Merged
merged 2 commits into from Feb 28, 2015
Merged

Add Settings::Container#reset!, set up inheritance relationship #323

merged 2 commits into from Feb 28, 2015

Conversation

adrienthebo
Copy link
Contributor

In order to add a rugged based Git implementation we need to subclass R10K::Git::Cache, which relies on having settings applied to the subclass. This adds adding some cleanup functionality for the tests for those examples, and reconfigures the settings mixin to properly handle inheritance of settings values.

In order to test classes that use settings without persisting state
beyond those tests we need a way to wipe all settings for that
container; this commit adds a #reset! method to do just that.
When a class with settings is subclassed, the settings applicable to
the superclass are generally applicable to the subclass. In order to
link up the  super/subclass relationship, this commit uses the
Class#inherited hook to manually create a settings instance in the
subclass that pulls settings from the superclass.
@andersonmills
Copy link
Contributor

Tested and happy with it. 👍

adrienthebo added a commit that referenced this pull request Feb 28, 2015
…ner-inheritance

Add Settings::Container#reset!, set up inheritance relationship
@adrienthebo adrienthebo merged commit d8e6ec0 into puppetlabs:master Feb 28, 2015
@adrienthebo adrienthebo deleted the maint/master/settings-container-inheritance branch February 28, 2015 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants