forked from voxpupuli/puppet-zabbix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
32 lines (29 loc) · 1.02 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
require 'rake'
require 'rspec/core/rake_task'
require 'puppetlabs_spec_helper/module_spec_helper'
require 'puppetlabs_spec_helper/rake_tasks'
desc "Run all RSpec code examples"
RSpec::Core::RakeTask.new(:rspec) do |t|
#t.rspec_opts = File.read("spec/spec.opts").chomp || ""
t.rspec_opts = ['--color', '--format', 'documentation']
end
SPEC_SUITES = (Dir.entries('spec') - ['.', '..','fixtures']).select {|e| File.directory? "spec/#{e}" }
namespace :rspec do
SPEC_SUITES.each do |suite|
desc "Run #{suite} RSpec code examples"
RSpec::Core::RakeTask.new(suite) do |t|
t.pattern = "spec/#{suite}/**/*_spec.rb"
#t.rspec_opts = File.read("spec/spec.opts").chomp || ""
t.rspec_opts = ['--color', '--format', 'documentation']
end
end
end
task :default => :rspec
begin
if Gem::Specification::find_by_name('puppet-lint')
require 'puppet-lint/tasks/puppet-lint'
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"]
task :default => [:rspec, :lint]
end
rescue Gem::LoadError
end