summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2019-08-06 21:04:22 -0700
committerTim Smith <tsmith84@gmail.com>2019-08-06 21:04:22 -0700
commit2e93ea1fe20b3d5e0e96d81d8e300cdcb63eba3b (patch)
treee67516f86ef4f533b44c0a06c64e3f23853660c5
parentcdb6b5c46072f782e241cddb318e0e9c71c7396b (diff)
downloadmixlib-log-2e93ea1fe20b3d5e0e96d81d8e300cdcb63eba3b.tar.gz
Use a standard rakefilebk_fixes
This has more error handling and better named groups Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--Rakefile36
1 files changed, 25 insertions, 11 deletions
diff --git a/Rakefile b/Rakefile
index adfd106..15fa270 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,28 +1,40 @@
require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-require "cucumber/rake/task"
-task default: %i{style spec features}
-
-Bundler::GemHelper.install_tasks
+begin
+ require "cucumber/rake/task"
-desc "Run specs"
-RSpec::Core::RakeTask.new(:spec) do |spec|
- spec.pattern = "spec/**/*_spec.rb"
+ Cucumber::Rake::Task.new(:features) do |t|
+ t.cucumber_opts = "--format pretty"
+ end
+rescue LoadError
+ desc "cucumber is not installed, this task is disabled"
+ task :spec do
+ abort "cucumber is not installed. bundle install first to make sure all dependencies are installed."
+ end
end
-Cucumber::Rake::Task.new(:features) do |t|
- t.cucumber_opts = "--format pretty"
+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
@@ -39,3 +51,5 @@ task :console do
ARGV.clear
IRB.start
end
+
+task default: %i{style spec features}