acceptance: Add a test verifying anonymous https cloning
authorDavid Schmitt <david.schmitt@puppetlabs.com>
Fri, 29 May 2015 12:00:42 +0000 (13:00 +0100)
committerDavid Schmitt <david.schmitt@puppetlabs.com>
Fri, 29 May 2015 12:00:42 +0000 (13:00 +0100)
In MODULES-891 the question arose whether https sources are supported.
This test shows that it works.

spec/acceptance/clone_repo_spec.rb

index 2cca061..c234550 100644 (file)
@@ -38,6 +38,30 @@ describe 'clones a remote repo' do
     end
   end
 
+  context 'using a https source on github' do
+    it 'clones a repo' do
+      pp = <<-EOS
+      vcsrepo { "#{tmpdir}/httpstestrepo":
+        ensure => present,
+        provider => git,
+        source => "https://github.com/puppetlabs/puppetlabs-vcsrepo.git",
+      }
+      EOS
+
+      # Run it twice and test for idempotency
+      apply_manifest(pp, :catch_failures => true)
+      apply_manifest(pp, :catch_changes => true)
+    end
+
+    describe file("#{tmpdir}/httpstestrepo/.git") do
+      it { is_expected.to be_directory }
+    end
+
+    describe file("#{tmpdir}/httpstestrepo/.git/HEAD") do
+      it { is_expected.to contain 'ref: refs/heads/master' }
+    end
+  end
+
   context 'using a commit SHA' do
     let (:sha) do
       shell("git --git-dir=#{tmpdir}/testrepo.git rev-list HEAD | tail -1").stdout.chomp