diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9cd3259..31a28d7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,7 +24,7 @@ jobs: echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list echo "deb [signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list sudo apt-get update - sudo apt-get install -y software-properties-common vagrant virtualbox-7.0 + sudo apt-get install -y software-properties-common vagrant virtualbox-7.1 - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: diff --git a/.rubocop.yml b/.rubocop.yml index 9909d8e..7955d9b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,8 +1,6 @@ --- -require: - - chefstyle - AllCops: + TargetRubyVersion: 3.1 Include: - "**/*.rb" Exclude: diff --git a/Gemfile b/Gemfile index 533b99b..9af3145 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,10 @@ source "https://rubygems.org" # Specify your gem"s dependencies in kitchen-vagrant.gemspec gemspec +if ENV['CHEF_TEST_KITCHEN_ENTERPRISE'] + gem "chef-test-kitchen-enterprise", git: "https://github.com/chef/test-kitchen", branch: "main" +end + group :test do gem "rake" gem "kitchen-inspec" @@ -13,6 +17,6 @@ group :debug do gem "pry" end -group :chefstyle do - gem "chefstyle", "2.2.3" +group :cookstyle do + gem "cookstyle" end diff --git a/Rakefile b/Rakefile index 71cfd2b..2b21951 100644 --- a/Rakefile +++ b/Rakefile @@ -7,13 +7,13 @@ RSpec::Core::RakeTask.new(:test) do |t| end begin - require "chefstyle" + require "cookstyle" require "rubocop/rake_task" RuboCop::RakeTask.new(:style) do |task| - task.options += ["--display-cop-names", "--no-color"] + task.options += ["--chefstyle", "--display-cop-names", "--no-color"] end rescue LoadError - puts "chefstyle is not available. (sudo) gem install chefstyle to do style checking." + puts "cookstyle is not available. (sudo) gem install cookstyle to do style checking." end task default: %i{test style} diff --git a/kitchen-vagrant.gemspec b/kitchen-vagrant.gemspec index a1acea2..4c99a00 100644 --- a/kitchen-vagrant.gemspec +++ b/kitchen-vagrant.gemspec @@ -17,5 +17,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 3.0" - gem.add_dependency "test-kitchen", ">= 1.4", "< 4" + unless ENV['CHEF_TEST_KITCHEN_ENTERPRISE'] + gem.add_dependency "test-kitchen", ">= 1.4", "< 4" + end end