summaryrefslogtreecommitdiff
path: root/puppet/modules/vcsrepo/spec/acceptance/modules_753_spec.rb
diff options
context:
space:
mode:
authorMicah <micah@leap.se>2016-07-12 16:46:26 -0400
committerMicah <micah@leap.se>2016-07-12 16:46:26 -0400
commit850a14b59444737f703686d0d1996bf09ab08e2b (patch)
tree6d67b59126fc9d8329b6acdd072b53b5ea35bc25 /puppet/modules/vcsrepo/spec/acceptance/modules_753_spec.rb
parent5247b7ccf5b5889ee16262dd976b03047e34e32c (diff)
git subrepo clone https://leap.se/git/puppet_vcsrepo puppet/modules/vcsrepo
subrepo: subdir: "puppet/modules/vcsrepo" merged: "4e23209" upstream: origin: "https://leap.se/git/puppet_vcsrepo" branch: "master" commit: "4e23209" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "1e79595" Change-Id: I72f8ecdef4855ef9da6e1486453b1cdf01bb54a3
Diffstat (limited to 'puppet/modules/vcsrepo/spec/acceptance/modules_753_spec.rb')
-rw-r--r--puppet/modules/vcsrepo/spec/acceptance/modules_753_spec.rb68
1 files changed, 68 insertions, 0 deletions
diff --git a/puppet/modules/vcsrepo/spec/acceptance/modules_753_spec.rb b/puppet/modules/vcsrepo/spec/acceptance/modules_753_spec.rb
new file mode 100644
index 00000000..e4e332bf
--- /dev/null
+++ b/puppet/modules/vcsrepo/spec/acceptance/modules_753_spec.rb
@@ -0,0 +1,68 @@
+require 'spec_helper_acceptance'
+
+tmpdir = default.tmpdir('vcsrepo')
+
+describe 'clones a remote repo' do
+ before(:all) do
+ my_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+ shell("mkdir -p #{tmpdir}") # win test
+ end
+
+ after(:all) do
+ shell("rm -rf #{tmpdir}/vcsrepo")
+ end
+
+ context 'clone with single remote' do
+ it 'clones from default remote' do
+ pp = <<-EOS
+ vcsrepo { "#{tmpdir}/vcsrepo":
+ ensure => present,
+ provider => git,
+ source => "https://github.com/puppetlabs/puppetlabs-vcsrepo.git",
+ }
+ EOS
+
+ apply_manifest(pp, :catch_failures => true)
+
+ end
+
+ it "git config output should contain the remote" do
+ shell("/usr/bin/git config -l -f #{tmpdir}/vcsrepo/.git/config") do |r|
+ expect(r.stdout).to match(/remote.origin.url=https:\/\/github.com\/puppetlabs\/puppetlabs-vcsrepo.git/)
+ end
+ end
+
+ after(:all) do
+ shell("rm -rf #{tmpdir}/vcsrepo")
+ end
+
+ end
+
+ context 'clone with multiple remotes' do
+ it 'clones from default remote and adds 2 remotes to config file' do
+ pp = <<-EOS
+ vcsrepo { "#{tmpdir}/vcsrepo":
+ ensure => present,
+ provider => git,
+ source => {"origin" => "https://github.com/puppetlabs/puppetlabs-vcsrepo.git", "test1" => "https://github.com/puppetlabs/puppetlabs-vcsrepo.git"},
+ }
+ EOS
+
+ apply_manifest(pp, :catch_failures => true)
+
+ end
+
+ it "git config output should contain the remotes" do
+ shell("/usr/bin/git config -l -f #{tmpdir}/vcsrepo/.git/config") do |r|
+ expect(r.stdout).to match(/remote.origin.url=https:\/\/github.com\/puppetlabs\/puppetlabs-vcsrepo.git/)
+ expect(r.stdout).to match(/remote.test1.url=https:\/\/github.com\/puppetlabs\/puppetlabs-vcsrepo.git/)
+ end
+ end
+
+ after(:all) do
+ shell("rm -rf #{tmpdir}/vcsrepo")
+ end
+
+ end
+
+end