require "bundler/gem_tasks"

require "rspec/core/rake_task"
%i{unit functional}.each do |type|
  RSpec::Core::RakeTask.new(type) do |t|
    t.pattern = "spec/#{type}/**/*_spec.rb"
    t.rspec_opts = [].tap do |a|
      a.push("--color")
      a.push("--format progress")
    end.join(" ")
  end
end

require "chefstyle"
require "rubocop/rake_task"
desc "Run Chefstyle tests"
RuboCop::RakeTask.new(:style) do |task|
  task.options += ["--display-cop-names", "--no-color"]
end

desc "Run all tests"
task test: %i{style unit functional}

task default: :test
