-
Notifications
You must be signed in to change notification settings - Fork 42
/
Rakefile
41 lines (32 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
require 'bundler/gem_tasks'
require 'puppetlabs_spec_helper/tasks/fixtures'
task :default => :spec
#### RUBOCOP ####
require 'rubocop/rake_task'
RuboCop::RakeTask.new(:rubocop) do |t|
t.options = ['--display-cop-names']
end
#### RSPEC ####
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
# thanks to the fixtures/modules/ symlinks this needs to exclude fixture modules explicitely
excludes = ['fixtures/**/*.rb,fixtures/modules/*/**/*.rb']
if RUBY_PLATFORM == 'java'
excludes += ['acceptance/**/*.rb', 'integration/**/*.rb', 'puppet/resource_api/*_context_spec.rb', 'puppet/util/network_device/simple/device_spec.rb']
t.rspec_opts = '--tag ~agent_test'
t.rspec_opts << ' --tag ~j17_exclude' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
end
t.exclude_pattern = "spec/{#{excludes.join ','}}"
end
task :spec => :spec_prep
namespace :spec do
desc 'Run RSpec code examples with coverage collection'
task :coverage do
ENV['SIMPLECOV'] = 'yes'
Rake::Task['spec'].execute
end
RSpec::Core::RakeTask.new(:unit) do |t|
t.pattern = "spec/puppet/**/*_spec.rb,spec/integration/**/*_spec.rb"
end
task :unit => :spec_prep
end