summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-07-21 11:47:07 -0700
committerNick Lewis <nick@puppetlabs.com>2011-07-21 20:10:18 -0700
commite2ea023f809c2bdc53b5259047c28f8061f57e54 (patch)
tree95d2e13dc944864dd20729c53682cc052d96d160 /spec/unit
parent4b0c847f19d5db81758b5561bdc8196591209ef0 (diff)
downloadpuppet-e2ea023f809c2bdc53b5259047c28f8061f57e54.tar.gz
puppet-e2ea023f809c2bdc53b5259047c28f8061f57e54.tar.xz
puppet-e2ea023f809c2bdc53b5259047c28f8061f57e54.zip
Remove caching from the catalog, types, and parameters
Types and parameters were registering their catalog as their expirer, so that the catalog could expire them between uses. However, because catalogs are never reused (and neither are types or parameters), there is no need to expire anything. Thus, we remove the entire cleanup/expire logic from catalog, type, and parameter. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/parameter_spec.rb10
-rwxr-xr-xspec/unit/resource/catalog_spec.rb25
-rwxr-xr-xspec/unit/type_spec.rb16
3 files changed, 0 insertions, 51 deletions
diff --git a/spec/unit/parameter_spec.rb b/spec/unit/parameter_spec.rb
index 04556c013..1ed211957 100755
--- a/spec/unit/parameter_spec.rb
+++ b/spec/unit/parameter_spec.rb
@@ -25,16 +25,6 @@ describe Puppet::Parameter do
@parameter.to_s.should == @parameter.name.to_s
end
- it "should be able to use cached attributes" do
- Puppet::Parameter.ancestors.should be_include(Puppet::Util::Cacher)
- end
-
- it "should use the resource catalog for expiration" do
- catalog = mock 'catalog'
- @resource.stubs(:catalog).returns catalog
- @parameter.expirer.should equal(catalog)
- end
-
[:line, :file, :version].each do |data|
it "should return its resource's #{data} as its #{data}" do
@resource.expects(data).returns "foo"
diff --git a/spec/unit/resource/catalog_spec.rb b/spec/unit/resource/catalog_spec.rb
index 5b914dac3..c03f05dee 100755
--- a/spec/unit/resource/catalog_spec.rb
+++ b/spec/unit/resource/catalog_spec.rb
@@ -10,23 +10,6 @@ describe Puppet::Resource::Catalog, "when compiling" do
Puppet::Util::Storage.stubs(:store)
end
- it "should be an Expirer" do
- Puppet::Resource::Catalog.ancestors.should be_include(Puppet::Util::Cacher::Expirer)
- end
-
- it "should always be expired if it's not applying" do
- @catalog = Puppet::Resource::Catalog.new("host")
- @catalog.expects(:applying?).returns false
- @catalog.should be_dependent_data_expired(Time.now)
- end
-
- it "should not be expired if it's applying and the timestamp is late enough" do
- @catalog = Puppet::Resource::Catalog.new("host")
- @catalog.expire
- @catalog.expects(:applying?).returns true
- @catalog.should_not be_dependent_data_expired(Time.now)
- end
-
it "should be able to write its list of classes to the class file" do
@catalog = Puppet::Resource::Catalog.new("host")
@@ -644,11 +627,6 @@ describe Puppet::Resource::Catalog, "when compiling" do
@catalog.apply(:ignoreschedules => true)
end
- it "should expire cached data in the resources both before and after the transaction" do
- @catalog.expects(:expire).times(2)
- @catalog.apply
- end
-
describe "host catalogs" do
# super() doesn't work in the setup method for some reason
@@ -809,8 +787,6 @@ describe Puppet::Resource::Catalog, "when compiling" do
@real_indirection = Puppet::Resource::Catalog.indirection
@indirection = stub 'indirection', :name => :catalog
-
- Puppet::Util::Cacher.expire
end
it "should use the value of the 'catalog_terminus' setting to determine its terminus class" do
@@ -829,7 +805,6 @@ describe Puppet::Resource::Catalog, "when compiling" do
end
after do
- Puppet::Util::Cacher.expire
@real_indirection.reset_terminus_class
end
end
diff --git a/spec/unit/type_spec.rb b/spec/unit/type_spec.rb
index 73150af48..218c626d2 100755
--- a/spec/unit/type_spec.rb
+++ b/spec/unit/type_spec.rb
@@ -4,10 +4,6 @@ require 'spec_helper'
describe Puppet::Type, :'fails_on_windows' => true do
include PuppetSpec::Files
- it "should include the Cacher module" do
- Puppet::Type.ancestors.should be_include(Puppet::Util::Cacher)
- end
-
it "should consider a parameter to be valid if it is a valid parameter" do
Puppet::Type.type(:mount).should be_valid_parameter(:path)
end
@@ -20,18 +16,6 @@ describe Puppet::Type, :'fails_on_windows' => true do
Puppet::Type.type(:mount).should be_valid_parameter(:noop)
end
- it "should use its catalog as its expirer" do
- catalog = Puppet::Resource::Catalog.new
- resource = Puppet::Type.type(:mount).new(:name => "foo", :fstype => "bar", :pass => 1, :ensure => :present)
- resource.catalog = catalog
- resource.expirer.should equal(catalog)
- end
-
- it "should do nothing when asked to expire when it has no catalog" do
- resource = Puppet::Type.type(:mount).new(:name => "foo", :fstype => "bar", :pass => 1, :ensure => :present)
- lambda { resource.expire }.should_not raise_error
- end
-
it "should be able to retrieve a property by name" do
resource = Puppet::Type.type(:mount).new(:name => "foo", :fstype => "bar", :pass => 1, :ensure => :present)
resource.property(:fstype).must be_instance_of(Puppet::Type.type(:mount).attrclass(:fstype))