1 require 'spec_helper_acceptance'
3 tmpdir = default.tmpdir('vcsrepo')
5 describe 'create a repo' do
6 context 'without a source' do
7 it 'creates a blank repo' do
9 vcsrepo { "#{tmpdir}/testrepo_blank_repo":
15 # Run it twice and test for idempotency
16 apply_manifest(pp, :catch_failures => true)
17 apply_manifest(pp, :catch_changes => true)
20 describe file("#{tmpdir}/testrepo_blank_repo/") do
21 it 'should have zero files' do
22 shell("ls -1 #{tmpdir}/testrepo_blank_repo | wc -l") do |r|
23 expect(r.stdout).to match(/^0\n$/)
28 describe file("#{tmpdir}/testrepo_blank_repo/.git") do
29 it { is_expected.to be_directory }
33 context 'bare repo' do
34 it 'creates a bare repo' do
36 vcsrepo { "#{tmpdir}/testrepo_bare_repo":
42 # Run it twice and test for idempotency
43 apply_manifest(pp, :catch_failures => true)
44 apply_manifest(pp, :catch_changes => true)
47 describe file("#{tmpdir}/testrepo_bare_repo/config") do
48 it { is_expected.to contain 'bare = true' }
51 describe file("#{tmpdir}/testrepo_bare_repo/.git") do
52 it { is_expected.not_to be_directory }
56 context 'bare repo with a revision' do
57 it 'does not create a bare repo when a revision is defined' do
59 vcsrepo { "#{tmpdir}/testrepo_bare_repo_rev":
66 apply_manifest(pp, :expect_failures => true)
69 describe file("#{tmpdir}/testrepo_bare_repo_rev") do
70 it { is_expected.not_to be_directory }