Skip to content

Commit 80ca154

Browse files
committed
(MAINT) Fix spec tests
Prior to this commit there were a number of failing spec tests. This commit fixes tests for git and svn.
1 parent 77dafcb commit 80ca154

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

spec/unit/puppet/provider/vcsrepo/git_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,9 @@ def branch_a_list(include_branch = nil?)
507507
it "uses 'git fetch --tags'" do
508508
resource.delete(:source)
509509
expect_chdir
510+
expect(provider).to receive(:exec_git).with('--version').and_return('2.36.1')
510511
expect(provider).to receive(:exec_git).with('fetch', 'origin')
511-
expect(provider).to receive(:exec_git).with('fetch', '--tags', 'origin')
512+
expect(provider).to receive(:exec_git).with('fetch', '--tags', '--force', 'origin')
512513
provider.update_references
513514
end
514515
end
@@ -562,6 +563,8 @@ def branch_a_list(include_branch = nil?)
562563
expect(FileUtils).to receive(:chown_R).with('john', nil, '/tmp/test')
563564
expect(provider).to receive(:exec_git).with('fetch', 'origin')
564565
expect(provider).to receive(:exec_git).with('fetch', '--tags', 'origin')
566+
567+
allow(provider).to receive(:exec_git).with('--version').and_return('2.13.0')
565568
provider.update_references
566569
end
567570
it 'with excludes run filtered chown_R' do
@@ -574,6 +577,8 @@ def branch_a_list(include_branch = nil?)
574577
expect(provider).to receive(:set_excludes)
575578
expect(provider).to receive(:exec_git).with('fetch', 'origin')
576579
expect(provider).to receive(:exec_git).with('fetch', '--tags', 'origin')
580+
581+
allow(provider).to receive(:exec_git).with('--version').and_return('2.13.0')
577582
provider.update_references
578583
end
579584
end

spec/unit/puppet/provider/vcsrepo/svn_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
*test_paths_parents)
100100
expect(provider).to receive(:svn_wrapper).with('--non-interactive', 'update',
101101
*resource[:includes])
102+
103+
allow(provider).to receive(:return_svn_client_version).and_return('1.8.0')
102104
provider.create
103105
end
104106
it 'performs a sparse checkout at a specific revision' do
@@ -118,6 +120,8 @@
118120
expect(provider).to receive(:svn_wrapper).with('--non-interactive', 'update', '-r',
119121
resource.value(:revision),
120122
*resource[:includes])
123+
124+
allow(provider).to receive(:return_svn_client_version).and_return('1.8.0')
121125
provider.create
122126
end
123127
it 'performs a sparse checkout with a specific depth' do
@@ -134,6 +138,8 @@
134138
expect(provider).to receive(:svn_wrapper).with('--non-interactive', 'update',
135139
'--depth', resource.value(:depth),
136140
*resource[:includes])
141+
142+
allow(provider).to receive(:return_svn_client_version).and_return('1.8.0')
137143
provider.create
138144
end
139145
it 'performs a sparse checkout at a specific depth and revision' do
@@ -155,6 +161,8 @@
155161
'-r', resource.value(:revision),
156162
'--depth', resource.value(:depth),
157163
*resource[:includes])
164+
165+
allow(provider).to receive(:return_svn_client_version).and_return('1.8.0')
158166
provider.create
159167
end
160168
end

0 commit comments

Comments
 (0)