forked from dagolden/perl-chef
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
40 lines (33 loc) · 879 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
31
32
33
34
35
36
37
38
39
40
require 'foodcritic'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
task default: ['style:chef', 'style:ruby', 'test:unit']
namespace :style do
desc 'Run Chef style checks'
FoodCritic::Rake::LintTask.new(:chef)
desc 'Run Ruby style checks'
RuboCop::RakeTask.new(:ruby) do
print_header('Rake - RuboCop: Running style checks')
end
end
namespace :test do
desc 'Run ChefSpec unit tests'
RSpec::Core::RakeTask.new(:unit) do |t|
print_header('Running ChefSpec unit tests')
t.rspec_opts = '--pattern test/unit/**/*_spec.rb'
t.verbose = false
end
end
def print_header(msg)
puts "\n"
puts '## ' + ('-' * 77)
puts "## #{msg}"
puts '## ' + ('-' * 77)
end
private :print_header
begin
require 'kitchen/rake_tasks'
Kitchen::RakeTasks.new
rescue LoadError
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
end