diff options
author | Tim Smith <tsmith@chef.io> | 2019-06-03 17:14:58 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2019-06-06 18:12:44 -0700 |
commit | 390b371ddef39052d4bc1d2604a8c757460de298 (patch) | |
tree | 394387a9de1ea3173bfb370affdf84eec979a1de /Rakefile | |
parent | 30c1eb1ef1c2a68c0a0883afbee66b4e811edabe (diff) | |
download | mixlib-shellout-390b371ddef39052d4bc1d2604a8c757460de298.tar.gz |
Add our standard Rakefile / Gemfile
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -1,23 +1,28 @@ -require "bundler" -require "rspec/core/rake_task" +require "bundler/gem_tasks" Bundler::GemHelper.install_tasks name: "mixlib-shellout" -task default: [:spec, :style] - -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 +39,5 @@ task :console do ARGV.clear IRB.start end + +task default: [:spec, :style] |