-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathRakefile
More file actions
28 lines (23 loc) · 821 Bytes
/
Rakefile
File metadata and controls
28 lines (23 loc) · 821 Bytes
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
task default: %w(test)
task test: %w(delivery kitchen)
task quick: :delivery
require 'cookstyle'
require 'rubocop/rake_task'
RuboCop::RakeTask.new(:cookstyle) do |task|
task.options = ['--display-cop-names', '--extra-details']
end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |task|
task.rspec_opts = ['--color', '--format progress']
end
desc 'Run linter and specs'
task :delivery do
g = 'Policyfile.lock.json'
File.delete(g) if File.exist?(g)
Rake::Task['cookstyle'].invoke
Rake::Task['spec'].invoke
end
desc 'Run test kitchen with optional KITCHEN_ARGS if that env is present. Defaults suite test to "all" if no KITCHEN_REGEXP env var is present'
task :kitchen do
sh 'kitchen test ' << %W(#{ENV['KITCHEN_REGEXP'] || 'all'} #{ENV['KITCHEN_ARGS']}).reject(&:empty?).join(' ')
end