forked from epost-dev/opennebula-puppet-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
43 lines (35 loc) · 1.18 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 'rake'
require 'rake/tasklib'
require 'rspec/core/rake_task'
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint'
desc 'Run the tests'
RSpec::Core::RakeTask.new(:do_test) do |t|
t.rspec_opts = ['--color', '-f d']
file_list = FileList['spec/**/*_spec.rb']
%w(support fixtures acceptance).each do |exclude|
file_list = file_list.exclude("spec/#{exclude}/**/*_spec.rb")
end
t.pattern = file_list
end
desc 'Generate the docs'
RSpec::Core::RakeTask.new(:doc) do |t|
t.rspec_opts = ['--format', 'documentation']
t.pattern = 'spec/*/*_spec.rb'
end
desc 'Run puppet-lint on the one manifests'
task :onelint do
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.ignore_paths = ['vendor/**/*.pp']
PuppetLint.configuration.with_filename = true
linter = PuppetLint.new
matched_files = FileList['spec/fixtures/modules/one/manifests/**/*.pp']
matched_files.to_a.each do |puppet_file|
linter.file = puppet_file
linter.run
end
fail if linter.errors? || (linter.warnings? && PuppetLint.configuration.fail_on_warnings)
end
task :default => [:spec_prep, :do_test, :onelint, :spec_clean]
task :test => [:default]