forked from chrisboulton/puppet-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
43 lines (38 loc) · 1.34 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
Rake::Task[:lint].clear
PuppetLint::RakeTask.new :lint do |config|
config.pattern = ['manifests/*.pp', 'manifests/**/*.pp']
config.disable_checks = [ '80chars', 'selector_inside_resource', 'documentation' ]
config.with_filename = true
config.with_context = true
config.fail_on_warnings = true
end
Rake::Task[:spec_standalone].clear
RSpec::Core::RakeTask.new(:spec_standalone) do |t|
t.rspec_opts = ['--color']
t.exclude_pattern = 'spec/fixtures/**/*'
t.pattern = 'spec/**/*_spec.rb'
end
Rake::Task[:spec_prep].clear
desc 'Create the fixtures directory'
task :spec_prep do
FileUtils::mkdir_p('spec/fixtures/modules/nginx')
FileUtils::mkdir_p('spec/fixtures/manifests')
FileUtils.chdir('spec/fixtures/modules/nginx') do
%w(files manifests templates).each do |dir|
FileUtils::ln_sf("../../../../#{dir}", '.')
end
end
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'
if File.zero?('spec/fixtures/manifests/site.pp')
FileUtils::rm_f('spec/fixtures/manifests/site.pp')
end
end
PuppetSyntax.exclude_paths = ["vendor/**/*", "gemfiles/vendor/**/*", "spec/fixtures/modules/**/*"]