diff options
| author | Luke Kanies <luke@puppetlabs.com> | 2010-04-12 22:33:32 -0700 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | ee0cc07544df334cdc549907b4dca8d8d115b7b7 (patch) | |
| tree | 647930e81adb8b36595d293121b762b26c8b0f87 /spec/unit/resource | |
| parent | 11189fb1fcf8fb410df3c833d20decb2ec7aa8c2 (diff) | |
| download | puppet-ee0cc07544df334cdc549907b4dca8d8d115b7b7.tar.gz puppet-ee0cc07544df334cdc549907b4dca8d8d115b7b7.tar.xz puppet-ee0cc07544df334cdc549907b4dca8d8d115b7b7.zip | |
Fixing #3533 - Removing all transaction cleanup
It's really slow and has no actual functionality
any more, since we just remove the catalogs from memory
anyway.
This should be a good speed boost for very little effort.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'spec/unit/resource')
| -rwxr-xr-x | spec/unit/resource/catalog.rb | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/spec/unit/resource/catalog.rb b/spec/unit/resource/catalog.rb index afa98fa35..a7caf090e 100755 --- a/spec/unit/resource/catalog.rb +++ b/spec/unit/resource/catalog.rb @@ -576,7 +576,6 @@ describe Puppet::Resource::Catalog, "when compiling" do @transaction = mock 'transaction' Puppet::Transaction.stubs(:new).returns(@transaction) @transaction.stubs(:evaluate) - @transaction.stubs(:cleanup) @transaction.stubs(:add_times) end @@ -597,11 +596,6 @@ describe Puppet::Resource::Catalog, "when compiling" do @catalog.apply end - it "should clean up the transaction" do - @transaction.expects :cleanup - @catalog.apply - end - it "should return the transaction" do @catalog.apply.should equal(@transaction) end @@ -626,37 +620,6 @@ describe Puppet::Resource::Catalog, "when compiling" do @catalog.apply(:ignoreschedules => true) end - it "should remove resources created mid-transaction" do - args = {:name => "/yay", :ensure => :file} - resource = stub 'file', :ref => "File[/yay]", :catalog= => @catalog, :title => "/yay", :[] => "/yay" - @transaction = mock 'transaction' - Puppet::Transaction.stubs(:new).returns(@transaction) - @transaction.stubs(:evaluate) - @transaction.stubs(:cleanup) - @transaction.stubs(:add_times) - Puppet::Type.type(:file).expects(:new).with(args).returns(resource) - resource.expects :remove - @catalog.apply do |trans| - @catalog.create_resource :file, args - @catalog.resource("File[/yay]").should equal(resource) - end - @catalog.resource("File[/yay]").should be_nil - end - - it "should remove resources added mid-transaction" do - @transaction = mock 'transaction' - Puppet::Transaction.stubs(:new).returns(@transaction) - @transaction.stubs(:evaluate) - @transaction.stubs(:cleanup) - @transaction.stubs(:add_times) - file = Puppet::Type.type(:file).new(:name => "/yay", :ensure => :file) - @catalog.apply do |trans| - @catalog.add_resource file - @catalog.resource("File[/yay]").should_not be_nil - end - @catalog.resource("File[/yay]").should be_nil - end - it "should expire cached data in the resources both before and after the transaction" do @catalog.expects(:expire).times(2) @catalog.apply |
