summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2019-12-20 21:53:04 -0800
committerTim Smith <tsmith84@gmail.com>2019-12-20 21:53:04 -0800
commit322fd21cee0815102af8bdc2be8b016d6ea346f0 (patch)
tree0c73278eaa52e3c7f44dbe52d82a7bba1140ca80 /Rakefile
parentcacf2ec72ca4f07f60a6ea97abd287a754d635ac (diff)
downloadwmi-lite-322fd21cee0815102af8bdc2be8b016d6ea346f0.tar.gz
Migrate testing to Buildkite
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile28
1 files changed, 27 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index c71976d..2e0489d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,4 +1,28 @@
-require 'bundler/gem_tasks'
+require "bundler/gem_tasks"
+
+begin
+ require "rspec/core/rake_task"
+
+ RSpec::Core::RakeTask.new do |t|
+ t.pattern = "spec/**/*_spec.rb"
+ end
+rescue LoadError
+ desc "rspec is not installed, this task is disabled"
+ task :spec do
+ abort "rspec is not installed. bundle install first to make sure all dependencies are installed."
+ end
+end
+
+begin
+ require "chefstyle"
+ require "rubocop/rake_task"
+ desc "Run Chefstyle tests"
+ RuboCop::RakeTask.new(:style) do |task|
+ task.options += ["--display-cop-names", "--no-color"]
+ end
+rescue LoadError
+ puts "chefstyle gem is not installed. bundle install first to make sure all dependencies are installed."
+end
begin
require "yard"
@@ -13,3 +37,5 @@ task :console do
ARGV.clear
IRB.start
end
+
+task default: %i{style spec}