summaryrefslogtreecommitdiffstats
path: root/spec/integration
diff options
context:
space:
mode:
Diffstat (limited to 'spec/integration')
-rwxr-xr-xspec/integration/transaction.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/integration/transaction.rb b/spec/integration/transaction.rb
new file mode 100755
index 000000000..17aba0df8
--- /dev/null
+++ b/spec/integration/transaction.rb
@@ -0,0 +1,25 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../spec_helper'
+
+require 'puppet/transaction'
+
+describe Puppet::Transaction do
+ it "should not apply generated resources if the parent resource fails" do
+ catalog = Puppet::Resource::Catalog.new
+ resource = Puppet::Type.type(:file).new :path => "/foo/bar"
+ catalog.add_resource resource
+
+ child_resource = Puppet::Type.type(:file).new :path => "/foo/bar/baz"
+
+ resource.expects(:eval_generate).returns([child_resource])
+
+ transaction = Puppet::Transaction.new(catalog)
+
+ resource.expects(:evaluate).raises "this is a failure"
+
+ child_resource.expects(:evaluate).never
+
+ transaction.evaluate
+ end
+end