From e2eaef984ae3ac194a65b3b15f5eb7cc13f84ab0 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Fri, 12 Jul 2024 23:17:34 +0530 Subject: [PATCH] updated Rakefile Signed-off-by: nikhil2611 --- Rakefile | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/Rakefile b/Rakefile index d234851..ffffb5a 100644 --- a/Rakefile +++ b/Rakefile @@ -1,55 +1,53 @@ -require "bundler/gem_tasks" +require 'bundler/gem_tasks' -WINDOWS_PLATFORM = %w{ x64-mingw32 x64-mingw-ucrt ruby }.freeze +WINDOWS_PLATFORM = %w[x64-mingw32 x64-mingw-ucrt ruby].freeze # Style Tests begin - require "chefstyle" - require "rubocop/rake_task" + require 'chefstyle' + require 'rubocop/rake_task' RuboCop::RakeTask.new do |t| - t.formatters = ["progress"] - t.options = ["-D"] + t.formatters = ['progress'] + t.options = ['-D'] end # style is an alias for rubocop task style: :rubocop rescue LoadError - puts "ChefStyle not available; disabling style checking tasks" + puts 'ChefStyle not available; disabling style checking tasks' end # Unit Tests begin - require "rspec/core/rake_task" + require 'rspec/core/rake_task' RSpec::Core::RakeTask.new # Coverage - desc "Generate unit test coverage report" + desc 'Generate unit test coverage report' task :coverage do - ENV["COVERAGE"] = "true" + ENV['COVERAGE'] = 'true' Rake::Task[:spec].invoke end rescue LoadError - puts "RSpec not available; disabling rspec tasks" + puts 'RSpec not available; disabling rspec tasks' # create a no-op spec task for :default task :spec end # Feature Tests begin - require "cucumber" - require "cucumber/rake/task" + require 'cucumber' + require 'cucumber/rake/task' Cucumber::Rake::Task.new(:features) do |t| - if RUBY_PLATFORM =~ WINDOWS_PLATFORM || RUBY_PLATFORM =~ /darwin/ - t.cucumber_opts = "--tags 'not @not-windows'" - end + t.cucumber_opts = "--tags 'not @not-windows'" if RUBY_PLATFORM =~ WINDOWS_PLATFORM || RUBY_PLATFORM =~ /darwin/ end rescue LoadError - puts "Cucumber/Aruba not available; disabling feature tasks" + puts 'Cucumber/Aruba not available; disabling feature tasks' # create a no-op spec task for :default task :features end # test or the default task runs spec, features, style -desc "run all tests" -task default: %i{coverage features style} +desc 'run all tests' +task default: %i[coverage features style] task test: :default