summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile32
1 files changed, 18 insertions, 14 deletions
diff --git a/Rakefile b/Rakefile
index 85326bb..ed73446 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,19 +1,23 @@
+require 'rubygems'
+# keep for compatibility for now
require 'puppetlabs_spec_helper/rake_tasks'
-require 'puppet-lint/tasks/puppet-lint'
-PuppetLint.configuration.send('disable_80chars')
-PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
+task :tests do
+ # run syntax checks on manifests, templates and hiera data
+ # also runs :metadata_lint
+ Rake::Task[:validate].invoke
-desc "Validate manifests, templates, and ruby files"
-task :validate do
- Dir['manifests/**/*.pp'].each do |manifest|
- sh "puppet parser validate --noop #{manifest}"
- end
- Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file|
- sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/
- end
- Dir['templates/**/*.erb'].each do |template|
- sh "erb -P -x -T '-' #{template} | ruby -c"
+ # runs puppet-lint
+ Rake::Task[:lint].invoke
+end
+
+# use librarian-puppet to manage fixtures instead of .fixtures.yml
+# offers more possibilities like explicit version management, forge downloads,...
+task :librarian_spec_prep do
+ sh "librarian-puppet install --path=spec/fixtures/modules/"
+ pwd = `pwd`.strip
+ unless File.directory?("#{pwd}/spec/fixtures/modules/tor")
+ sh "ln -s #{pwd} #{pwd}/spec/fixtures/modules/tor"
end
end
-task :test => [:lint, :syntax , :validate, :spec]
+task :spec_prep => :librarian_spec_prep