(fixtures): Fix cloud module reference (need to be a symlink)

In order to run rspec tests on the current branch/patchset, cloud
module (in fixtures directory) need to be a symlink on the working
directory, otherwise the rspec test use master branch of cloud module.

Refs: #724
This commit is contained in:
Sebastien Badia 2014-11-16 21:30:09 +01:00
parent d342e754f9
commit c239b0bb71
2 changed files with 15 additions and 9 deletions

2
.gitignore vendored
View File

@ -5,3 +5,5 @@ Gemfile.lock
.vendor
doc/
.yardoc
.librarian/
.tmp/

View File

@ -58,19 +58,23 @@ namespace :module do
end
Rake::Task[:spec_prep].clear
desc "Create the fixtures directory"
desc 'Create the fixtures directory'
task :spec_prep do
FileUtils::mkdir_p("spec/fixtures/modules")
FileUtils::mkdir_p("spec/fixtures/manifests")
FileUtils::touch("spec/fixtures/manifests/site.pp")
sh "librarian-puppet install --path=spec/fixtures/modules"
FileUtils::mkdir_p('spec/fixtures/modules')
FileUtils::mkdir_p('spec/fixtures/manifests')
FileUtils::touch('spec/fixtures/manifests/site.pp')
sh 'librarian-puppet install --path=spec/fixtures/modules'
if File.exists?('spec/fixtures/modules/cloud')
FileUtils::rm_rf('spec/fixtures/modules/cloud')
FileUtils::ln_s(TDIR, 'spec/fixtures/modules/cloud')
end
end
Rake::Task[:spec_clean].clear
desc "Clean up the fixtures directory"
desc 'Clean up the fixtures directory'
task :spec_clean do
sh "librarian-puppet clean --path=spec/fixtures/modules"
if File.zero?("spec/fixtures/manifests/site.pp")
FileUtils::rm_f("spec/fixtures/manifests/site.pp")
sh 'librarian-puppet clean --path=spec/fixtures/modules'
if File.zero?('spec/fixtures/manifests/site.pp')
FileUtils::rm_f('spec/fixtures/manifests/site.pp')
end
end