|
4 | 4 |
|
5 | 5 | tmpdir = '/tmp/vcsrepo' |
6 | 6 |
|
7 | | -describe 'subversion :includes tests on SVN version >= 1.7', unless: ( # rubocop:disable RSpec/MultipleDescribes : The |
| 7 | +describe 'subversion :includes tests on SVN version >= 1.7', unless: ( # : The |
8 | 8 | # test's on this page must be kept seperate as they are for different operating systems. |
9 | | - (os[:family] == 'redhat' && os[:release].start_with?('5', '6')) || |
10 | 9 | (os[:family] == 'sles') |
11 | 10 | ) do |
12 | 11 | before(:all) do |
|
149 | 148 | end |
150 | 149 | end |
151 | 150 | end |
152 | | - |
153 | | -describe 'subversion :includes tests on SVN version == 1.6', if: ( |
154 | | - (os[:family] == 'redhat' && os[:release].start_with?('5', '6')) |
155 | | - ) do |
156 | | - after(:all) do |
157 | | - run_shell("rm -rf #{tmpdir}/svnrepo") |
158 | | - end |
159 | | - |
160 | | - context 'with include paths' do |
161 | | - pp = <<-MANIFEST |
162 | | - vcsrepo { "#{tmpdir}/svnrepo": |
163 | | - ensure => present, |
164 | | - provider => svn, |
165 | | - includes => ['difftools/README', 'obsolete-notes',], |
166 | | - source => "http://svn.apache.org/repos/asf/subversion/developer-resources", |
167 | | - revision => 1000000, |
168 | | - } |
169 | | - MANIFEST |
170 | | - it 'can checkout specific paths from svn' do |
171 | | - # Run it twice and test for idempotency |
172 | | - idempotent_apply(pp) |
173 | | - end |
174 | | - |
175 | | - describe file("#{tmpdir}/svnrepo/difftools") do |
176 | | - it { is_expected.to be_directory } |
177 | | - end |
178 | | - |
179 | | - describe file("#{tmpdir}/svnrepo/difftools/README") do |
180 | | - its(:md5sum) { is_expected.to eq '540241e9d5d4740d0ef3d27c3074cf93' } |
181 | | - end |
182 | | - |
183 | | - describe file("#{tmpdir}/svnrepo/difftools/pics") do |
184 | | - it { is_expected.not_to exist } |
185 | | - end |
186 | | - |
187 | | - describe file("#{tmpdir}/svnrepo/obsolete-notes") do |
188 | | - it { is_expected.to be_directory } |
189 | | - end |
190 | | - |
191 | | - describe file("#{tmpdir}/svnrepo/obsolete-notes/draft-korn-vcdiff-01.txt") do |
192 | | - its(:md5sum) { is_expected.to eq '37019f808e1af64864853a67526cfe19' } |
193 | | - end |
194 | | - |
195 | | - describe file("#{tmpdir}/svnrepo/obsolete-notes/vcdiff-karlnotes") do |
196 | | - its(:md5sum) { is_expected.to eq '26e23ff6a156de14aebd1099e23ac2d8' } |
197 | | - end |
198 | | - |
199 | | - describe file("#{tmpdir}/svnrepo/guis") do |
200 | | - it { is_expected.not_to exist } |
201 | | - end |
202 | | - end |
203 | | - |
204 | | - context 'with add include paths' do |
205 | | - pp = <<-MANIFEST |
206 | | - vcsrepo { "#{tmpdir}/svnrepo": |
207 | | - ensure => present, |
208 | | - provider => svn, |
209 | | - includes => ['difftools/README', 'obsolete-notes', 'guis/pics', 'difftools/pics/README'], |
210 | | - source => "http://svn.apache.org/repos/asf/subversion/developer-resources", |
211 | | - revision => 1000000, |
212 | | - } |
213 | | - MANIFEST |
214 | | - it 'can add paths to includes' do |
215 | | - # Run it twice and test for idempotency |
216 | | - idempotent_apply(pp) |
217 | | - end |
218 | | - |
219 | | - describe file("#{tmpdir}/svnrepo/guis/pics/README") do |
220 | | - its(:md5sum) { is_expected.to eq '62bdc9180684042fe764d89c9beda40f' } |
221 | | - end |
222 | | - |
223 | | - describe file("#{tmpdir}/svnrepo/difftools/pics/README") do |
224 | | - its(:md5sum) { is_expected.to eq 'bad02dfc3cb96bf5cadd59bf4fe3e00e' } |
225 | | - end |
226 | | - end |
227 | | - |
228 | | - context 'with remove include paths' do |
229 | | - pp = <<-MANIFEST |
230 | | - vcsrepo { "#{tmpdir}/svnrepo": |
231 | | - ensure => present, |
232 | | - provider => svn, |
233 | | - includes => ['difftools/pics/README', 'obsolete-notes',], |
234 | | - source => "http://svn.apache.org/repos/asf/subversion/developer-resources", |
235 | | - revision => 1000000, |
236 | | - } |
237 | | - MANIFEST |
238 | | - it 'can remove directory paths (and empty parent directories) from includes, but not files with siblings' do |
239 | | - apply_manifest(pp, catch_failures: true) |
240 | | - end |
241 | | - |
242 | | - describe file("#{tmpdir}/svnrepo/guis/pics/README") do |
243 | | - it { is_expected.not_to exist } |
244 | | - end |
245 | | - |
246 | | - describe file("#{tmpdir}/svnrepo/guis/pics") do |
247 | | - it { is_expected.not_to exist } |
248 | | - end |
249 | | - |
250 | | - describe file("#{tmpdir}/svnrepo/guis") do |
251 | | - it { is_expected.not_to exist } |
252 | | - end |
253 | | - |
254 | | - describe file("#{tmpdir}/svnrepo/difftools/pics/README") do |
255 | | - its(:md5sum) { is_expected.to eq 'bad02dfc3cb96bf5cadd59bf4fe3e00e' } |
256 | | - end |
257 | | - |
258 | | - describe file("#{tmpdir}/svnrepo/difftools/README") do |
259 | | - its(:md5sum) { is_expected.to eq '540241e9d5d4740d0ef3d27c3074cf93' } |
260 | | - end |
261 | | - end |
262 | | - |
263 | | - context 'with changing revisions' do |
264 | | - pp = <<-MANIFEST |
265 | | - vcsrepo { "#{tmpdir}/svnrepo": |
266 | | - ensure => present, |
267 | | - provider => svn, |
268 | | - includes => ['difftools/README', 'obsolete-notes',], |
269 | | - source => "http://svn.apache.org/repos/asf/subversion/developer-resources", |
270 | | - revision => 1700000, |
271 | | - } |
272 | | - MANIFEST |
273 | | - it 'can change revisions' do |
274 | | - # Run it twice and test for idempotency |
275 | | - idempotent_apply(pp) |
276 | | - end |
277 | | - |
278 | | - it 'svn info of svnrepo' do |
279 | | - run_shell("svn info #{tmpdir}/svnrepo") do |r| |
280 | | - expect(r.stdout).to match(%r{.*Revision: 1700000.*}) |
281 | | - end |
282 | | - end |
283 | | - |
284 | | - it 'svn info of svnrepo/difftools/README' do |
285 | | - run_shell("svn info #{tmpdir}/svnrepo/difftools/README") do |r| |
286 | | - expect(r.stdout).to match(%r{.*Revision: 1700000.*}) |
287 | | - end |
288 | | - end |
289 | | - end |
290 | | -end |
0 commit comments