summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-08-07 09:49:52 -0700
committerGitHub <noreply@github.com>2019-08-07 09:49:52 -0700
commitc7756710233ef80e383ecabef25074f5b7968544 (patch)
treee184ac80d8abb766fb817c023a64f32bb029c4c5 /Rakefile
parent51dcee25b0ae6e614e5ebbc42eca0e1e3041865b (diff)
parent76b305a788968538b5ce0c7223b8b0fe470f0c31 (diff)
downloadmixlib-log-c7756710233ef80e383ecabef25074f5b7968544.tar.gz
Merge pull request #56 from chef/bk_fixes
Add windows testing in Buildkite
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile39
1 files changed, 27 insertions, 12 deletions
diff --git a/Rakefile b/Rakefile
index 1b9ec9a..5442c99 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,28 +1,41 @@
-require "bundler/gem_tasks"
-require "rspec/core/rake_task"
-require "cucumber/rake/task"
+require "bundler"
-task default: [: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"
+ t.bundler = false
+ 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 +52,5 @@ task :console do
ARGV.clear
IRB.start
end
+
+task default: %i{style spec features}