Update stdlib and concat to 6.1.0 both
[mirror/dsa-puppet.git] / 3rdparty / modules / concat / spec / acceptance / quoted_paths_spec.rb
index 042425f..e331c08 100644 (file)
@@ -1,42 +1,33 @@
-require 'spec_helper_acceptance'\r
-\r
-describe 'quoted paths' do\r
-  basedir = default.tmpdir('concat')\r
-\r
-  before(:all) do\r
-    pp = <<-EOS\r
-      file { '#{basedir}':\r
-        ensure => directory,\r
-      }\r
-      file { '#{basedir}/concat test':\r
-        ensure => directory,\r
-      }\r
-    EOS\r
-    apply_manifest(pp)\r
-  end\r
-\r
-  context 'path with blanks' do\r
-    pp = <<-EOS\r
-      concat { '#{basedir}/concat test/foo':\r
-      }\r
-      concat::fragment { '1':\r
-        target  => '#{basedir}/concat test/foo',\r
-        content => 'string1',\r
-      }\r
-      concat::fragment { '2':\r
-        target  => '#{basedir}/concat test/foo',\r
-        content => 'string2',\r
-      }\r
-    EOS\r
-\r
-    it 'applies the manifest twice with no stderr' do\r
-      apply_manifest(pp, :catch_failures => true)\r
-      apply_manifest(pp, :catch_changes => true)\r
-    end\r
-\r
-    describe file("#{basedir}/concat test/foo") do\r
-      it { should be_file }\r
-      its(:content) { should match /string1string2/ }\r
-    end\r
-  end\r
-end\r
+require 'spec_helper_acceptance'
+
+describe 'quoted paths' do
+  before(:all) do
+    @basedir = setup_test_directory
+  end
+
+  describe 'with path with blanks' do
+    let(:pp) do
+      <<-MANIFEST
+        file { '#{@basedir}/concat test':
+          ensure => directory,
+        }
+        concat { '#{@basedir}/concat test/foo':
+        }
+        concat::fragment { '1':
+          target  => '#{@basedir}/concat test/foo',
+          content => 'string1',
+        }
+        concat::fragment { '2':
+          target  => '#{@basedir}/concat test/foo',
+          content => 'string2',
+        }
+      MANIFEST
+    end
+
+    it 'applies the manifest twice with no stderr' do
+      idempotent_apply(pp)
+      expect(file("#{@basedir}/concat test/foo")).to be_file
+      expect(file("#{@basedir}/concat test/foo").content).to match %r{string1string2}
+    end
+  end
+end