summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-06-10 17:07:13 -0700
committerTim Smith <tsmith@chef.io>2019-06-10 17:07:13 -0700
commit31da0d42b1758c8307d2981e0233c03db2ad5cd3 (patch)
tree69d2dd8574037c00b6c8a8b369c66cad5d98c210
parent6297efe16ecb1bf79964b7a7a65145f68138e8d2 (diff)
downloadmixlib-cli-31da0d42b1758c8307d2981e0233c03db2ad5cd3.tar.gz
Use our standard rakefile
Rescue failures and use chefstyle in the description. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--Rakefile23
1 files changed, 14 insertions, 9 deletions
diff --git a/Rakefile b/Rakefile
index 1baff27..199e0ce 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,23 +1,26 @@
require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-task default: [:style, :spec]
-
-Bundler::GemHelper.install_tasks
-
-desc "Run specs"
-RSpec::Core::RakeTask.new(:spec) do |spec|
- spec.pattern = "spec/**/*_spec.rb"
+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/rubocop is not available. bundle install first to make sure all dependencies are installed."
+ puts "chefstyle gem is not installed. bundle install first to make sure all dependencies are installed."
end
begin
@@ -34,3 +37,5 @@ task :console do
ARGV.clear
IRB.start
end
+
+task default: [:spec, :style]