2016-02-16 11:38:48 +00:00
|
|
|
#!/usr/bin/env rake
|
2014-06-22 13:00:34 +00:00
|
|
|
|
2016-02-16 11:38:48 +00:00
|
|
|
require 'rake/testtask'
|
2014-06-16 14:20:21 +00:00
|
|
|
require 'rubocop/rake_task'
|
2014-06-05 08:50:37 +00:00
|
|
|
|
2014-06-16 14:20:21 +00:00
|
|
|
# Rubocop
|
|
|
|
desc 'Run Rubocop lint checks'
|
|
|
|
task :rubocop do
|
2014-06-22 10:57:10 +00:00
|
|
|
RuboCop::RakeTask.new
|
2014-06-16 14:20:21 +00:00
|
|
|
end
|
|
|
|
|
2016-02-16 11:38:48 +00:00
|
|
|
# lint the project
|
|
|
|
desc 'Run robocop linter'
|
|
|
|
task lint: [:rubocop]
|
2014-06-16 14:20:21 +00:00
|
|
|
|
2016-02-16 11:38:48 +00:00
|
|
|
# run tests
|
|
|
|
task default: [:lint, 'test:check']
|
2014-06-05 08:50:37 +00:00
|
|
|
|
2016-02-16 11:38:48 +00:00
|
|
|
namespace :test do
|
|
|
|
# run inspec check to verify that the profile is properly configured
|
|
|
|
task :check do
|
|
|
|
dir = File.join(File.dirname(__FILE__))
|
|
|
|
sh("bundle exec inspec check #{dir}")
|
2014-06-05 08:50:37 +00:00
|
|
|
end
|
|
|
|
end
|