forked from epost-dev/opennebula-puppet-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
39 lines (31 loc) · 1.02 KB
/
Rakefile
File metadata and controls
39 lines (31 loc) · 1.02 KB
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
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']
t.pattern = 'spec/*/*_spec.rb'
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]