Add test for git clone using file path
authorJohn Duarte <john.duarte@puppetlabs.com>
Tue, 6 May 2014 04:04:24 +0000 (21:04 -0700)
committerJohn Duarte <john.duarte@puppetlabs.com>
Sun, 18 May 2014 18:38:18 +0000 (11:38 -0700)
spec/acceptance/git_clone_protocols_spec.rb

index ec56625..ec99629 100644 (file)
@@ -68,6 +68,31 @@ hosts.each do |host|
 
     end
 
+    context 'using local protocol (file path)' do
+      before(:all) do
+        on(host,apply_manifest("file {'#{tmpdir}/testrepo': ensure => directory, purge => true, recurse => true, recurselimit => 1, force => true; }"))
+      end
+
+      it 'should have HEAD pointing to master' do
+        pp = <<-EOS
+        vcsrepo { "#{tmpdir}/testrepo":
+          ensure => present,
+          provider => git,
+          source => "#{tmpdir}/testrepo.git",
+        }
+        EOS
+
+        # Run it twice and test for idempotency
+        on(host,apply_manifest(pp, :catch_failures => true))
+        on(host,apply_manifest(pp, :catch_changes => true))
+      end
+
+      describe file("#{tmpdir}/testrepo/.git/HEAD") do
+        it { should contain 'ref: refs/heads/master' }
+      end
+
+    end
+
     context 'using git protocol' do
       before(:all) do
         on(host,apply_manifest("file {'#{tmpdir}/testrepo': ensure => directory, purge => true, recurse => true, recurselimit => 1, force => true; }"))