diff options
| author | Luke Kanies <luke@madstop.com> | 2009-04-21 01:13:49 -0500 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-04-22 14:39:40 +1000 |
| commit | d06bd3ede2a5ba0017e90e2937092a986d5b356c (patch) | |
| tree | 24a5adab88c28642c15b652b7e9805e69d9e9aaa /spec | |
| parent | b694b3c0696cc9bd0f109bf0a7c790f592bc6180 (diff) | |
Finishing class renames
I missed some of the Catalog mentions, and its
constant changed.
I've also added tests so this will get caught
next time.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/integration/defaults.rb | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/spec/integration/defaults.rb b/spec/integration/defaults.rb index 46b5fd64e..66693818f 100755 --- a/spec/integration/defaults.rb +++ b/spec/integration/defaults.rb @@ -92,4 +92,61 @@ describe "Puppet defaults" do ENV["PATH"].split(File::PATH_SEPARATOR).should be_include("/sbin") end end + + describe "when enabling storeconfigs" do + before do + Puppet::Resource::Catalog.stubs(:cache_class=) + Puppet::Node::Facts.stubs(:cache_class=) + Puppet::Node.stubs(:cache_class=) + end + + it "should set the Catalog cache class to :active_record" do + Puppet::Resource::Catalog.expects(:cache_class=).with(:active_record) + Puppet.settings[:storeconfigs] = true + end + + it "should not set the Catalog cache class to :active_record if asynchronous storeconfigs is enabled" do + Puppet::Resource::Catalog.expects(:cache_class=).with(:active_record).never + Puppet.settings.expects(:value).with(:async_storeconfigs).returns true + Puppet.settings[:storeconfigs] = true + end + + it "should set the Facts cache class to :active_record" do + Puppet::Node::Facts.expects(:cache_class=).with(:active_record) + Puppet.settings[:storeconfigs] = true + end + + it "should set the Node cache class to :active_record" do + Puppet::Node.expects(:cache_class=).with(:active_record) + Puppet.settings[:storeconfigs] = true + end + end + + describe "when enabling asynchronous storeconfigs" do + before do + Puppet::Resource::Catalog.stubs(:cache_class=) + Puppet::Node::Facts.stubs(:cache_class=) + Puppet::Node.stubs(:cache_class=) + end + + it "should set storeconfigs to true" do + Puppet.settings[:async_storeconfigs] = true + Puppet.settings[:storeconfigs].should be_true + end + + it "should set the Catalog cache class to :queue" do + Puppet::Resource::Catalog.expects(:cache_class=).with(:queue) + Puppet.settings[:async_storeconfigs] = true + end + + it "should set the Facts cache class to :active_record" do + Puppet::Node::Facts.expects(:cache_class=).with(:active_record) + Puppet.settings[:storeconfigs] = true + end + + it "should set the Node cache class to :active_record" do + Puppet::Node.expects(:cache_class=).with(:active_record) + Puppet.settings[:storeconfigs] = true + end + end end |
