diff options
| author | Luke Kanies <luke@madstop.com> | 2008-05-05 21:14:46 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-05-05 21:14:46 -0500 |
| commit | e57436f1056cceb8ecdfadfa618911c5595c72e2 (patch) | |
| tree | 8e4314dbc7a754ba19c07971686ee03c8c5ed68e /spec | |
| parent | 137e29ff0e33ff5cbb4032d452abc5a5aef2c941 (diff) | |
The Settings class now clears the 'used' sections when a value is changed.
This makes is so that if you, for instance, reset the vardir,
then the next time an initialization call is made, we reuse
any previously used sections, thus (hopefully) correctly
creating any newly needed directories.
This is mostly helpful during testing.
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/util/settings.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/util/settings.rb b/spec/unit/util/settings.rb index 441a3f4ef..ca533ef9a 100755 --- a/spec/unit/util/settings.rb +++ b/spec/unit/util/settings.rb @@ -93,6 +93,11 @@ describe Puppet::Util::Settings, " when setting values" do @settings[:myval].should == "yay" end + it "should clear the list of used sections" do + @settings.expects(:clearused) + @settings[:myval] = "yay" + end + it "should call passed blocks when values are set" do values = [] @settings.setdefaults(:section, :hooker => {:default => "yay", :desc => "boo", :hook => lambda { |v| values << v }}) |
