diff options
author | Tim Smith <tsmith@chef.io> | 2019-06-24 23:35:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-24 23:35:37 -0700 |
commit | 0af9dde31dcc518a4af4af66cb3ae14e1a3c6bd7 (patch) | |
tree | 3896e30f5eb3fff2aba2555a7e60dc5abb289333 | |
parent | 6297efe16ecb1bf79964b7a7a65145f68138e8d2 (diff) | |
parent | e26a76bcab94ec7716c932863bb972698d0e94af (diff) | |
download | mixlib-cli-0af9dde31dcc518a4af4af66cb3ae14e1a3c6bd7.tar.gz |
Merge pull request #68 from chef/rake
Use our standard rakefile
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | Rakefile | 23 |
2 files changed, 16 insertions, 10 deletions
@@ -1,6 +1,7 @@ # Mixlib::CLI - [](https://badge.fury.io/rb/mixlib-cli) +[](https://buildkite.com/chef-oss/chef-mixlib-cli-master-verify) +[](https://badge.fury.io/rb/mixlib-cli) **Umbrella Project**: [Chef Foundation](https://github.com/chef/chef-oss-practices/blob/master/projects/chef-foundation.md) @@ -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] |