-
Notifications
You must be signed in to change notification settings - Fork 14
/
Rakefile
30 lines (27 loc) · 936 Bytes
/
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
require 'rake'
require 'rspec/core/rake_task'
desc "Run all RSpec code examples"
RSpec::Core::RakeTask.new(:rspec) do |t|
File.exist?('spec/spec.opts') ? opts = File.read("spec/spec.opts").chomp : opts = ""
t.rspec_opts = opts
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"
File.exist?('spec/spec.opts') ? opts = File.read("spec/spec.opts").chomp : opts = ""
t.rspec_opts = opts
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