Created
November 14, 2014 19:29
-
-
Save mgagne/f6e60b438d4d77fe3837 to your computer and use it in GitHub Desktop.
Using librarian-puppet-simple to read Puppetfile for your rspec-puppet fixtures
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Don't forget to add librarian-puppet-simple to your Gemfile | |
# From git | |
gem 'librarian-puppet-simple', | |
:git => 'git://github.com/bodepd/librarian-puppet-simple.git' | |
# From rubygems | |
gem 'librarian-puppet-simple', '~> 0.0.3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'puppetlabs_spec_helper/rake_tasks' | |
Rake::Task[:spec_prep].clear | |
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" | |
end | |
Rake::Task[:spec_clean].clear | |
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") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment