From 8d3e112fec38627096e7d18d796e3abeaf677d66 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Fri, 29 May 2015 13:00:42 +0100 Subject: acceptance: Add a test verifying anonymous https cloning In MODULES-891 the question arose whether https sources are supported. This test shows that it works. --- spec/acceptance/clone_repo_spec.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'spec/acceptance') diff --git a/spec/acceptance/clone_repo_spec.rb b/spec/acceptance/clone_repo_spec.rb index 2cca061..c234550 100644 --- a/spec/acceptance/clone_repo_spec.rb +++ b/spec/acceptance/clone_repo_spec.rb @@ -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 -- cgit v1.2.3