Update concat
[mirror/dsa-puppet.git] / 3rdparty / modules / concat / spec / acceptance / concurrency_spec.rb
diff --git a/3rdparty/modules/concat/spec/acceptance/concurrency_spec.rb b/3rdparty/modules/concat/spec/acceptance/concurrency_spec.rb
new file mode 100644 (file)
index 0000000..fcffdbd
--- /dev/null
@@ -0,0 +1,37 @@
+require 'spec_helper_acceptance'
+
+describe 'with file recursive purge' do
+  basedir = default.tmpdir('concat')
+  context 'should still create concat file' do
+    pp = <<-EOS
+      file { '#{basedir}/bar':
+        ensure => directory,
+        purge  => true,
+        recurse => true,
+      }
+
+      concat { "foobar":
+        ensure => 'present',
+        path   => '#{basedir}/bar/foobar',
+      }
+
+      concat::fragment { 'foo':
+        target => 'foobar',
+        content => 'foo',
+      }
+    EOS
+
+    it 'applies the manifest twice with no stderr' do
+      apply_manifest(pp, :catch_failures => true)
+      apply_manifest(pp, :catch_changes => true)
+    end
+
+    describe file("#{basedir}/bar/foobar") do
+      it { should be_file }
+      its(:content) {
+        should match 'foo'
+      }
+    end
+  end
+end
+