-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathRakefile
43 lines (37 loc) · 932 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
41
42
43
require 'bundler/setup'
desc 'Clean some generated files'
task :clean do
%w(
Berksfile.lock
.bundle
.cache
coverage
Gemfile.lock
.kitchen
metadata.json
vendor
).each { |f| FileUtils.rm_rf(Dir.glob(f)) }
end
namespace :style do
require 'cookstyle'
require 'rubocop/rake_task'
RuboCop::RakeTask.new(:ruby) do |task|
task.options << '--display-cop-names'
end
require 'foodcritic'
desc 'Run Chef style checks using foodcritic'
FoodCritic::Rake::LintTask.new(:chef)
end
desc 'Run all style checks'
task style: %w(style:chef style:ruby)
desc 'Run ChefSpec unit tests'
task :unit do
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:unit) do |t|
# t.rspec_opts = '--color --format progress'
t.rspec_opts = '--color --format documentation'
t.pattern = 'spec/unit/**{,/*/**}/*_spec.rb'
end
end
desc 'Run style and unit tests'
task default: %w(style unit)