diff --git a/.rubocop.yml b/.rubocop.yml index 1fdb10b..df89f34 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,10 +1,10 @@ -Encoding: +Style/Encoding: Enabled: false -LineLength: +Layout/LineLength: Max: 100 -MethodLength: +Metrics/MethodLength: Max: 50 -HashSyntax: +Style/HashSyntax: Enabled: false Metrics/ModuleLength: diff --git a/.travis.yml b/.travis.yml index cec6a94..c7fad67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,22 @@ # Use Travis's cointainer based infrastructure language: ruby rvm: -- 2.1.1 +- 3.0.1 sudo: false cache: bundler addons: apt: sources: - - chef-stable-precise + - chef-current-xenial packages: - - chefdk + - chef-workstation -# Ensure we make ChefDK's Ruby the default +env: + - CHEF_LICENSE=accept + +# Ensure we make Chef Workstation's Ruby the default before_script: - - eval "$(/opt/chefdk/bin/chef shell-init bash)" + - eval "$(chef shell-init bash)" - chef exec bundle install script: - chef --version diff --git a/Berksfile.lock b/Berksfile.lock index 379edc1..9be912e 100644 --- a/Berksfile.lock +++ b/Berksfile.lock @@ -11,10 +11,5 @@ DEPENDENCIES GRAPH chef_handler (2.1.1) minitest-handler (1.5.1) - chef_handler (>= 0.0.0) minitest-handler_test1 (0.0.1) - chef_handler (>= 0.0.0) - minitest-handler (>= 0.0.0) minitest-handler_test2 (0.0.1) - chef_handler (>= 0.0.0) - minitest-handler (>= 0.0.0) diff --git a/Gemfile b/Gemfile index 0812b27..650baa4 100644 --- a/Gemfile +++ b/Gemfile @@ -1,23 +1,22 @@ source 'https://rubygems.org' -gem 'berkshelf', '~> 5.6' -gem 'chefspec', '~> 6.2' -gem 'rubocop', '= 0.34.2' -gem 'foodcritic', '~> 10.3' +gem 'berkshelf', '~> 7.2' +gem 'chefspec', '~> 9.3' +gem 'rubocop', '~> 1.15' +gem 'cookstyle', '~> 7.13' gem 'stove' group :kitchen do - gem 'test-kitchen', '~> 1.4', '>= 1.4.2' - gem 'kitchen-vagrant', '~> 0.19.0' - gem 'kitchen-digitalocean', '~> 0.9.3' - gem 'kitchen-docker', '~> 2.3' - gem 'kitchen-openstack', '~> 2.1' - gem 'winrm-transport', '~> 1.0', '>= 1.0.2' + gem 'test-kitchen', '~> 2.12' + gem 'kitchen-vagrant', '~> 1.8' + gem 'kitchen-digitalocean', '~> 0.12.0' + gem 'kitchen-docker', '~> 2.10' + gem 'kitchen-openstack', '~> 6.0' end group :integration do gem 'rake' gem 'minitest', '~> 4.7.0', '>= 4.7.5' gem 'busser-bats' - gem 'minitest-chef-handler', '~> 1.0.0', '>= 1.0.3' + gem 'minitest-chef-handler', '~> 1.1' end diff --git a/Gemfile.lock b/Gemfile.lock index 7653639..b055974 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,527 +1,426 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (2.3.5) - activesupport (4.0.13) - i18n (~> 0.6, >= 0.6.9) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - addressable (2.5.1) - public_suffix (~> 2.0, >= 2.0.2) - artifactory (2.8.1) - ast (2.3.0) - astrolabe (1.3.1) - parser (~> 2.2) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + ast (2.4.2) axiom-types (0.1.1) descendants_tracker (~> 0.0.4) ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) - backports (3.7.0) - berkshelf (5.6.4) - addressable (~> 2.3, >= 2.3.4) - berkshelf-api-client (>= 2.0.2, < 4.0) - buff-config (~> 2.0) - buff-extensions (~> 2.0) - buff-shell_out (~> 1.0) + bcrypt_pbkdf (1.1.0) + berkshelf (7.2.2) + chef (>= 15.7.32) + chef-config cleanroom (~> 1.0) - faraday (~> 0.9) - httpclient (~> 2.7) - minitar (~> 0.5, >= 0.5.4) - mixlib-archive (~> 0.4) + concurrent-ruby (~> 1.0) + minitar (>= 0.6) + mixlib-archive (>= 1.1.4, < 2.0) + mixlib-config (>= 2.2.5) + mixlib-shellout (>= 2.0, < 4.0) octokit (~> 4.0) - retryable (~> 2.0) - ridley (~> 5.0) - solve (> 2.0, < 4.0) - thor (~> 0.19, < 0.19.2) - berkshelf-api-client (3.0.0) - faraday (~> 0.9) - httpclient (~> 2.7) - ridley (>= 4.5, < 6.0) - buff-config (2.0.0) - buff-extensions (~> 2.0) - varia_model (~> 0.6) - buff-extensions (2.0.0) - buff-ignore (1.2.0) - buff-ruby_engine (1.0.0) - buff-shell_out (1.1.0) - buff-ruby_engine (~> 1.0) - builder (3.2.3) - busser (0.7.1) - thor (<= 0.19.0) + retryable (>= 2.0, < 4.0) + solve (~> 4.0) + thor (>= 0.20) + builder (3.2.4) + busser (0.6.0) + thor busser-bats (0.3.0) busser - celluloid (0.16.0) - timers (~> 4.0.0) - celluloid-io (0.16.2) - celluloid (>= 0.16.0) - nio4r (>= 1.1.0) - chef (13.0.118) + chef (17.2.29) addressable - bundler (>= 1.10) - chef-config (= 13.0.118) - chef-zero (>= 13.0) - diff-lcs (~> 1.2, >= 1.2.4) + chef-config (= 17.2.29) + chef-utils (= 17.2.29) + chef-vault + chef-zero (>= 14.0.11) + diff-lcs (>= 1.2.4, < 1.4.0) erubis (~> 2.7) + ffi (>= 1.5.0) + ffi-libarchive (~> 1.0, >= 1.0.3) ffi-yajl (~> 2.2) - highline (~> 1.6, >= 1.6.9) iniparse (~> 1.4) - iso8601 (~> 0.9.1) - mixlib-archive (~> 0.4) - mixlib-authentication (~> 1.4) - mixlib-cli (~> 1.7) - mixlib-log (~> 1.3) - mixlib-shellout (~> 2.0) - net-sftp (~> 2.1, >= 2.1.2) - net-ssh (>= 2.9, < 5.0) - net-ssh-multi (~> 1.2, >= 1.2.1) - ohai (~> 13.0) + inspec-core (~> 4.23) + license-acceptance (>= 1.0.5, < 3) + mixlib-archive (>= 0.4, < 2.0) + mixlib-authentication (>= 2.1, < 4) + mixlib-cli (>= 2.1.1, < 3.0) + mixlib-log (>= 2.0.3, < 4.0) + mixlib-shellout (>= 3.1.1, < 4.0) + net-sftp (>= 2.1.2, < 4.0) + ohai (~> 17.0) plist (~> 3.2) proxifier (~> 1.0) - rspec-core (~> 3.5) - rspec-expectations (~> 3.5) - rspec-mocks (~> 3.5) - rspec_junit_formatter (~> 0.2.0) - serverspec (~> 2.7) - specinfra (~> 2.10) syslog-logger (~> 1.6) - uuidtools (~> 2.1.5) - chef-api (0.7.0) - logify (~> 0.1) + train-core (~> 3.2, >= 3.2.28) + train-winrm (>= 0.2.5) + uuidtools (>= 2.1.5, < 3.0) + chef-api (0.10.10) mime-types - chef-config (13.0.118) + mixlib-log (>= 1, < 4) + chef-cli (5.1.0) + addressable (>= 2.3.5, < 2.8) + chef (>= 15.0) + cookbook-omnifetch (~> 0.5) + diff-lcs (>= 1.0, < 1.4) + ffi-yajl (>= 1.0, < 3.0) + license-acceptance (>= 1.0.11, < 3) + minitar (~> 0.6) + mixlib-cli (>= 1.7, < 3.0) + mixlib-shellout (>= 2.0, < 4.0) + pastel (~> 0.7) + solve (> 2.0, < 5.0) + chef-config (17.2.29) addressable + chef-utils (= 17.2.29) fuzzyurl - mixlib-config (~> 2.0) - mixlib-shellout (~> 2.0) - chef-zero (13.0.0) + mixlib-config (>= 2.2.12, < 4.0) + mixlib-shellout (>= 2.0, < 4.0) + tomlrb (~> 1.2) + chef-telemetry (1.0.29) + chef-config + concurrent-ruby (~> 1.0) + chef-utils (17.2.29) + concurrent-ruby + chef-vault (4.1.0) + chef-zero (15.0.7) ffi-yajl (~> 2.2) - hashie (>= 2.0, < 4.0) - mixlib-log (~> 1.3) - rack (~> 2.0) + hashie (>= 2.0, < 5.0) + mixlib-log (>= 2.0, < 4.0) + rack (~> 2.0, >= 2.0.6) uuidtools (~> 2.1) - chefspec (6.2.0) - chef (>= 12.0) - fauxhai (>= 3.6, < 5) + webrick + chefspec (9.3.0) + chef (>= 15) + chef-cli + fauxhai-ng (>= 7.5) rspec (~> 3.0) ci_reporter (1.9.3) builder (>= 2.1.2) cleanroom (1.0.0) + coderay (1.1.3) coercible (1.0.0) descendants_tracker (~> 0.0.1) - cucumber-core (2.0.0) - backports (~> 3.6) - gherkin (~> 4.0) + concurrent-ruby (1.1.9) + cookbook-omnifetch (0.11.1) + mixlib-archive (>= 0.4, < 2.0) + cookstyle (7.13.0) + rubocop (= 1.15.0) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) diff-lcs (1.3) - droplet_kit (1.4.3) - activesupport (> 3.0, < 5.1) - faraday (~> 0.9.1) + droplet_kit (3.14.0) + faraday (>= 0.15) kartograph (~> 0.2.3) resource_kit (~> 0.1.5) virtus (~> 1.0.3) + ed25519 (1.2.4) equalizer (0.0.11) + erubi (1.10.0) erubis (2.7.0) - excon (0.55.0) - faraday (0.9.2) + excon (0.82.0) + faraday (1.4.2) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.1) multipart-post (>= 1.2, < 3) - fauxhai (4.1.0) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.1.0) + faraday_middleware (1.0.0) + faraday (~> 1.0) + fauxhai-ng (9.0.0) net-ssh - ffi (1.9.18) - ffi-yajl (2.3.0) - libyajl2 (~> 1.2) - fission (0.5.0) - CFPropertyList (~> 2.2) - fog (1.40.0) - fog-aliyun (>= 0.1.0) - fog-atmos - fog-aws (>= 0.6.0) - fog-brightbox (~> 0.4) - fog-cloudatcost (~> 0.1.0) - fog-core (~> 1.43) - fog-digitalocean (>= 0.3.0) - fog-dnsimple (~> 1.0) - fog-dynect (~> 0.0.2) - fog-ecloud (~> 0.1) - fog-google (<= 0.1.0) - fog-json - fog-local - fog-openstack - fog-powerdns (>= 0.1.1) - fog-profitbricks - fog-rackspace - fog-radosgw (>= 0.0.2) - fog-riakcs - fog-sakuracloud (>= 0.0.4) - fog-serverlove - fog-softlayer - fog-storm_on_demand - fog-terremark - fog-vmfusion - fog-voxel - fog-vsphere (>= 0.4.0) - fog-xenserver - fog-xml (~> 0.1.1) - ipaddress (~> 0.5) - json (>= 1.8, < 2.0) - fog-aliyun (0.1.0) - fog-core (~> 1.27) - fog-json (~> 1.0) - ipaddress (~> 0.8) - xml-simple (~> 1.1) - fog-atmos (0.1.0) - fog-core - fog-xml - fog-aws (1.3.0) - fog-core (~> 1.38) - fog-json (~> 1.0) - fog-xml (~> 0.1) - ipaddress (~> 0.8) - fog-brightbox (0.11.0) - fog-core (~> 1.22) - fog-json - inflecto (~> 0.0.2) - fog-cloudatcost (0.1.2) - fog-core (~> 1.36) - fog-json (~> 1.0) - fog-xml (~> 0.1) - ipaddress (~> 0.8) - fog-core (1.43.0) + ffi (1.15.3) + ffi-libarchive (1.0.17) + ffi (~> 1.0) + ffi-yajl (2.4.0) + libyajl2 (>= 1.2) + fog-core (2.2.4) builder - excon (~> 0.49) + excon (~> 0.71) formatador (~> 0.2) - fog-digitalocean (0.3.0) - fog-core (~> 1.42) - fog-json (>= 1.0) - fog-xml (>= 0.1) - ipaddress (>= 0.5) - fog-dnsimple (1.0.0) - fog-core (~> 1.38) - fog-json (~> 1.0) - fog-dynect (0.0.3) - fog-core - fog-json - fog-xml - fog-ecloud (0.3.0) - fog-core - fog-xml - fog-google (0.1.0) + mime-types + fog-json (1.2.0) fog-core - fog-json - fog-xml - fog-json (1.0.2) - fog-core (~> 1.0) multi_json (~> 1.10) - fog-local (0.3.1) - fog-core (~> 1.27) - fog-openstack (0.1.20) - fog-core (>= 1.40) + fog-openstack (1.0.11) + fog-core (~> 2.1) fog-json (>= 1.0) ipaddress (>= 0.8) - fog-powerdns (0.1.1) - fog-core (~> 1.27) - fog-json (~> 1.0) - fog-xml (~> 0.1) - fog-profitbricks (3.0.0) - fog-core (~> 1.42) - fog-json (~> 1.0) - fog-rackspace (0.1.4) - fog-core (>= 1.35) - fog-json (>= 1.0) - fog-xml (>= 0.1) - ipaddress (>= 0.8) - fog-radosgw (0.0.5) - fog-core (>= 1.21.0) - fog-json - fog-xml (>= 0.0.1) - fog-riakcs (0.1.0) - fog-core - fog-json - fog-xml - fog-sakuracloud (1.7.5) - fog-core - fog-json - fog-serverlove (0.1.2) - fog-core - fog-json - fog-softlayer (1.1.4) - fog-core - fog-json - fog-storm_on_demand (0.1.1) - fog-core - fog-json - fog-terremark (0.1.0) - fog-core - fog-xml - fog-vmfusion (0.1.0) - fission - fog-core - fog-voxel (0.1.0) - fog-core - fog-xml - fog-vsphere (1.9.1) - fog-core - rbvmomi (~> 1.9) - fog-xenserver (0.3.0) - fog-core - fog-xml - fog-xml (0.1.3) - fog-core - nokogiri (>= 1.5.11, < 2.0.0) - foodcritic (10.3.1) - cucumber-core (>= 1.3) - erubis - nokogiri (>= 1.5, < 2.0) - rake - rufus-lru (~> 1.0) - treetop (~> 1.4) - yajl-ruby (~> 1.1) - formatador (0.2.5) + formatador (0.3.0) fuzzyurl (0.9.0) - gherkin (4.1.1) - gssapi (1.2.0) + gssapi (1.3.1) ffi (>= 1.0.1) gyoku (1.3.1) builder (>= 2.1.2) - hashie (3.5.5) - highline (1.7.8) - hitimes (1.2.4) + hashie (4.1.0) httpclient (2.8.3) - i18n (0.8.1) ice_nine (0.11.2) - inflecto (0.0.2) - iniparse (1.4.2) + iniparse (1.5.0) + inspec-core (4.37.30) + addressable (~> 2.4) + chef-telemetry (~> 1.0, >= 1.0.8) + faraday (>= 0.9.0, < 1.5) + faraday_middleware (~> 1.0) + hashie (>= 3.4, < 5.0) + license-acceptance (>= 0.2.13, < 3.0) + method_source (>= 0.8, < 2.0) + mixlib-log (~> 3.0) + multipart-post (~> 2.0) + parallel (~> 1.9) + parslet (>= 1.5, < 2.0) + pry (~> 0.13) + rspec (>= 3.9, < 3.11) + rspec-its (~> 1.2) + rubyzip (>= 1.2.2, < 3.0) + semverse (~> 3.0) + sslshake (~> 1.2) + thor (>= 0.20, < 2.0) + tomlrb (>= 1.2, < 2.1) + train-core (~> 3.0) + tty-prompt (~> 0.17) + tty-table (~> 0.10) ipaddress (0.8.3) - iso8601 (0.9.1) - json (1.8.6) - kartograph (0.2.4) - kitchen-digitalocean (0.9.5) - droplet_kit (~> 1.0) - test-kitchen (~> 1.2) - kitchen-docker (2.6.0) + json (2.5.1) + kartograph (0.2.8) + kitchen-digitalocean (0.12.0) + droplet_kit (>= 3.7, < 4.0) + test-kitchen (>= 1.17, < 3) + kitchen-docker (2.10.0) test-kitchen (>= 1.0.0) - kitchen-openstack (2.2.0) - fog (~> 1.33) + kitchen-openstack (6.0.0) + fog-openstack (~> 1.0) ohai - test-kitchen (~> 1.4, >= 1.4.1) - unf - kitchen-vagrant (0.19.0) - test-kitchen (~> 1.4) - libyajl2 (1.2.0) + test-kitchen (>= 1.4.1, < 3) + kitchen-vagrant (1.8.0) + test-kitchen (>= 1.4, < 3) + libyajl2 (2.1.0) + license-acceptance (2.1.13) + pastel (~> 0.7) + tomlrb (>= 1.2, < 3.0) + tty-box (~> 0.6) + tty-prompt (~> 0.20) little-plugger (1.1.4) - logging (2.2.2) + logging (2.3.0) little-plugger (~> 1.1) - multi_json (~> 1.10) - logify (0.2.0) - mime-types (3.1) + multi_json (~> 1.14) + method_source (1.0.0) + mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mini_portile2 (2.1.0) - minitar (0.6.1) + mime-types-data (3.2021.0225) + minitar (0.9) minitest (4.7.5) - minitest-chef-handler (1.0.3) - chef (>= 10.12.0) + minitest-chef-handler (1.1.0) ci_reporter (< 2.0) minitest (~> 4.7.3) - mixlib-archive (0.4.1) - mixlib-log - mixlib-authentication (1.4.1) + mixlib-archive (1.1.7) mixlib-log - mixlib-cli (1.7.0) - mixlib-config (2.2.4) - mixlib-install (2.1.12) - artifactory + mixlib-authentication (3.0.10) + mixlib-cli (2.1.8) + mixlib-config (3.0.9) + tomlrb + mixlib-install (3.12.11) mixlib-shellout mixlib-versioning thor - mixlib-log (1.7.1) - mixlib-shellout (2.2.7) - mixlib-versioning (1.1.0) - molinillo (0.5.7) - multi_json (1.12.1) - multipart-post (2.0.0) - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-sftp (2.1.2) - net-ssh (>= 2.6.5) - net-ssh (4.1.0) - net-ssh-gateway (1.3.0) - net-ssh (>= 2.6.5) - net-ssh-multi (1.2.1) - net-ssh (>= 2.6.5) - net-ssh-gateway (>= 1.2.0) - net-telnet (0.1.1) - nio4r (2.0.0) - nokogiri (1.7.1) - mini_portile2 (~> 2.1.0) + mixlib-log (3.0.9) + mixlib-shellout (3.2.5) + chef-utils + mixlib-versioning (1.2.12) + molinillo (0.7.0) + multi_json (1.15.0) + multipart-post (2.1.1) + net-scp (3.0.0) + net-ssh (>= 2.6.5, < 7.0.0) + net-sftp (3.0.0) + net-ssh (>= 5.0.0, < 7.0.0) + net-ssh (6.1.0) + net-ssh-gateway (2.0.0) + net-ssh (>= 4.0.0) nori (2.6.0) - octokit (4.7.0) + octokit (4.21.0) + faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) - ohai (13.0.1) - chef-config (>= 12.5.0.alpha.1, < 14) + ohai (17.1.0) + chef-config (>= 14.12, < 18) + chef-utils (>= 16.0, < 18) ffi (~> 1.9) ffi-yajl (~> 2.2) ipaddress - mixlib-cli - mixlib-config (~> 2.0) - mixlib-log (>= 1.7.1, < 2.0) - mixlib-shellout (~> 2.0) + mixlib-cli (>= 1.7.0) + mixlib-config (>= 2.0, < 4.0) + mixlib-log (>= 2.0.1, < 4.0) + mixlib-shellout (~> 3.2, >= 3.2.5) plist (~> 3.1) - systemu (~> 2.6.4) + train-core wmi-lite (~> 1.0) - parser (2.4.0.0) - ast (~> 2.2) - plist (3.2.0) - polyglot (0.3.5) - powerpack (0.1.1) + parallel (1.20.1) + parser (3.0.1.1) + ast (~> 2.4.1) + parslet (1.8.2) + pastel (0.8.0) + tty-color (~> 0.5) + plist (3.6.0) proxifier (1.0.3) - public_suffix (2.0.5) - rack (2.0.1) - rainbow (2.2.1) - rake (12.0.0) - rbvmomi (1.11.0) - builder (~> 3.0) - json (>= 1.8) - nokogiri (~> 1.5) - trollop (~> 2.1) - resource_kit (0.1.6) + pry (0.14.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.6) + rack (2.2.3) + rainbow (3.0.0) + rake (13.0.3) + regexp_parser (2.1.1) + resource_kit (0.1.7) addressable (>= 2.3.6, < 3.0.0) - retryable (2.0.4) - ridley (5.1.0) - addressable - buff-config (~> 2.0) - buff-extensions (~> 2.0) - buff-ignore (~> 1.2) - buff-shell_out (~> 1.0) - celluloid (~> 0.16.0) - celluloid-io (~> 0.16.1) - chef-config (>= 12.5.0) - erubis - faraday (~> 0.9.0) - hashie (>= 2.0.2, < 4.0.0) - httpclient (~> 2.7) - json (>= 1.7.7) - mixlib-authentication (>= 1.3.0) - retryable (~> 2.0) - semverse (~> 2.0) - varia_model (~> 0.6) - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-core (3.5.4) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) + retryable (3.0.5) + rexml (3.2.5) + rspec (3.10.0) + rspec-core (~> 3.10.0) + rspec-expectations (~> 3.10.0) + rspec-mocks (~> 3.10.0) + rspec-core (3.10.1) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-its (1.2.0) + rspec-support (~> 3.10.0) + rspec-its (1.3.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.5.0) + rspec-mocks (3.10.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-support (3.5.0) - rspec_junit_formatter (0.2.3) - builder (< 4) - rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.34.2) - astrolabe (~> 1.3) - parser (>= 2.2.2.5, < 3.0) - powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) - ruby-progressbar (~> 1.4) - ruby-progressbar (1.8.1) - rubyntlm (0.6.1) - rubyzip (1.2.1) - rufus-lru (1.1.0) - safe_yaml (1.0.4) - sawyer (0.8.1) - addressable (>= 2.3.5, < 2.6) - faraday (~> 0.8, < 1.0) - semverse (2.0.0) - serverspec (2.38.0) - multi_json - rspec (~> 3.0) - rspec-its - specinfra (~> 2.53) - sfl (2.3) - solve (3.1.0) - molinillo (>= 0.5) - semverse (>= 1.1, < 3.0) - specinfra (2.67.8) - net-scp - net-ssh (>= 2.7, < 5.0) - net-telnet - sfl - stove (5.1.0) + rspec-support (~> 3.10.0) + rspec-support (3.10.2) + rubocop (1.15.0) + parallel (~> 1.10) + parser (>= 3.0.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.5.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.7.0) + parser (>= 3.0.1.1) + ruby-progressbar (1.11.0) + ruby2_keywords (0.0.4) + rubyntlm (0.6.3) + rubyzip (2.3.0) + sawyer (0.8.2) + addressable (>= 2.3.5) + faraday (> 0.8, < 2.0) + semverse (3.0.0) + solve (4.0.4) + molinillo (~> 0.6) + semverse (>= 1.1, < 4.0) + sslshake (1.3.1) + stove (7.1.6) chef-api (~> 0.5) - logify (~> 0.2) + mixlib-log (>= 2.0) + strings (0.2.1) + strings-ansi (~> 0.2) + unicode-display_width (>= 1.5, < 3.0) + unicode_utils (~> 1.4) + strings-ansi (0.2.0) syslog-logger (1.6.8) - systemu (2.6.5) - test-kitchen (1.16.0) - mixlib-install (>= 1.2, < 3.0) - mixlib-shellout (>= 1.2, < 3.0) - net-scp (~> 1.1) - net-ssh (>= 2.9, < 5.0) - net-ssh-gateway (~> 1.2) - safe_yaml (~> 1.0) - thor (~> 0.19, < 0.19.2) - thor (0.19.0) + test-kitchen (2.12.0) + bcrypt_pbkdf (~> 1.0) + chef-utils (>= 16.4.35) + ed25519 (~> 1.2) + license-acceptance (>= 1.0.11, < 3.0) + mixlib-install (~> 3.6) + mixlib-shellout (>= 1.2, < 4.0) + net-scp (>= 1.1, < 4.0) + net-ssh (>= 2.9, < 7.0) + net-ssh-gateway (>= 1.2, < 3.0) + thor (>= 0.19, < 2.0) + winrm (~> 2.0) + winrm-elevated (~> 1.0) + winrm-fs (~> 1.1) + thor (1.1.0) thread_safe (0.3.6) - timers (4.0.4) - hitimes - treetop (1.6.8) - polyglot (~> 0.3) - trollop (2.1.2) - tzinfo (0.3.53) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.3) - uuidtools (2.1.5) - varia_model (0.6.0) - buff-extensions (~> 2.0) - hashie (>= 2.0.2, < 4.0.0) + tomlrb (1.3.0) + train-core (3.7.4) + addressable (~> 2.5) + ffi (!= 1.13.0) + json (>= 1.8, < 3.0) + mixlib-shellout (>= 2.0, < 4.0) + net-scp (>= 1.2, < 4.0) + net-ssh (>= 2.9, < 7.0) + train-winrm (0.2.12) + winrm (>= 2.3.6, < 3.0) + winrm-elevated (~> 1.2.2) + winrm-fs (~> 1.0) + tty-box (0.7.0) + pastel (~> 0.8) + strings (~> 0.2.0) + tty-cursor (~> 0.7) + tty-color (0.6.0) + tty-cursor (0.7.1) + tty-prompt (0.23.1) + pastel (~> 0.8) + tty-reader (~> 0.8) + tty-reader (0.9.0) + tty-cursor (~> 0.7) + tty-screen (~> 0.8) + wisper (~> 2.0) + tty-screen (0.8.1) + tty-table (0.12.0) + pastel (~> 0.8) + strings (~> 0.2.0) + tty-screen (~> 0.8) + unicode-display_width (2.0.0) + unicode_utils (1.4.0) + uuidtools (2.2.0) virtus (1.0.5) axiom-types (~> 0.1) coercible (~> 1.0) descendants_tracker (~> 0.0, >= 0.0.3) equalizer (~> 0.0, >= 0.0.9) - winrm (1.8.1) + webrick (1.7.0) + winrm (2.3.6) builder (>= 2.1.2) + erubi (~> 1.8) gssapi (~> 1.2) gyoku (~> 1.0) httpclient (~> 2.2, >= 2.2.0.2) logging (>= 1.6.1, < 3.0) nori (~> 2.0) - rubyntlm (~> 0.6.0) - winrm-transport (1.0.4) - rubyzip (~> 1.1, >= 1.1.7) - winrm (~> 1.3) - wmi-lite (1.0.0) - xml-simple (1.1.5) - yajl-ruby (1.3.0) + rubyntlm (~> 0.6.0, >= 0.6.3) + winrm-elevated (1.2.3) + erubi (~> 1.8) + winrm (~> 2.0) + winrm-fs (~> 1.0) + winrm-fs (1.3.5) + erubi (~> 1.8) + logging (>= 1.6.1, < 3.0) + rubyzip (~> 2.0) + winrm (~> 2.0) + wisper (2.0.1) + wmi-lite (1.0.5) PLATFORMS ruby DEPENDENCIES - berkshelf (~> 5.6) + berkshelf (~> 7.2) busser-bats - chefspec (~> 6.2) - foodcritic (~> 10.3) - kitchen-digitalocean (~> 0.9.3) - kitchen-docker (~> 2.3) - kitchen-openstack (~> 2.1) - kitchen-vagrant (~> 0.19.0) + chefspec (~> 9.3) + cookstyle (~> 7.13) + kitchen-digitalocean (~> 0.12.0) + kitchen-docker (~> 2.10) + kitchen-openstack (~> 6.0) + kitchen-vagrant (~> 1.8) minitest (~> 4.7.0, >= 4.7.5) - minitest-chef-handler (~> 1.0.0, >= 1.0.3) + minitest-chef-handler (~> 1.1) rake - rubocop (= 0.34.2) + rubocop (~> 1.15) stove - test-kitchen (~> 1.4, >= 1.4.2) - winrm-transport (~> 1.0, >= 1.0.2) + test-kitchen (~> 2.12) BUNDLED WITH - 1.14.6 + 2.2.21 diff --git a/README.md b/README.md index 6b0779a..343779f 100644 --- a/README.md +++ b/README.md @@ -29,17 +29,6 @@ test files named "_test.rb" rather than all test files in the path If you have any helper libraries, they should match `files/default/test/*helper*.rb` ## Attributes -* `node[:minitest][:gem_version]` - The version of the [minitest](http://rubygems.org/gems/minitest) - gem to install and use. - * Default: 3.0.1 -* `node[:minitest][:chef_handler_gem_version]` - The version of the [minitest-chef-handler](http://rubygems.org/gems/minitest-chef-handler) - gem to install and use. - * Default: 1.0.3 -* `node[:minitest][:chef_handler_gem_source]` - Alternate remote source for the minitest-chef-handler gem if not using RubyGems.org.(Ex http://mysource.com/gems') - * Default: RubyGems.org -* `node[:minitest][:ci_reporter_gem_version]` - The version of the [ci_reporter](http://rubygems.org/gems/ci_reporter) - gem to install and use. - * Default: 1.9.2 * `node[:minitest][:path]` - Location to store and find test files. * Default: `/var/chef/minitest` * `node[:minitest][:recipes]` - The names of all recipes included during the diff --git a/Rakefile b/Rakefile index ea4076e..792ff88 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,6 @@ #!/usr/bin/env rake -require 'foodcritic' -require 'rubocop' +require 'cookstyle' +require 'rubocop/rake_task' require 'rspec/core' task :default => 'test' @@ -9,41 +9,12 @@ task :default => 'test' desc 'Run tests' task :test do - Rake::Task[:foodcritic].execute Rake::Task[:rubocop].execute Rake::Task[:rspec].execute end -desc 'Runs foodcritic linter' -task :foodcritic do - if Gem::Version.new('1.9.2') <= Gem::Version.new(RUBY_VERSION.dup) - - puts 'Running foodcritic checks' - review = ::FoodCritic::Linter.new.check( - cookbook_paths: ['./'], - search_gems: true, - tags: ['~FC001'] - ) - if review.warnings.any? - puts review - exit !review.failed? - else - puts 'No foodcritic issues' - end - else - puts "WARN: foodcritic run is skipped as Ruby #{RUBY_VERSION} is < 1.9.2." - end -end - -desc 'Run Rubocop' -task :rubocop do - puts 'Running Rubocop Style Checks' - result = RuboCop::CLI.new.run([]) - if result == 0 - puts 'No Rubocop errors' - else - exit result - end +RuboCop::RakeTask.new(:rubocop) do |task| + task.options << '--display-cop-names' end desc 'Perform rspec tests' diff --git a/attributes/default.rb b/attributes/default.rb index 1ed182f..b820820 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,28 +1,17 @@ -# The version of the minitest gem to install -default[:minitest][:gem_version] = '3.0.1' - -# The version of the minitest-chef-handler gem to install -default[:minitest][:chef_handler_gem_version] = '1.1.0' -default[:minitest][:chef_handler_gem_source] = nil - -# The version of the ci_reporter gem to install -default[:minitest][:ci_reporter_gem_version] = '1.9.3' - default[:minitest][:tests] = '**/*_test.rb' default[:minitest][:recipes] = [] default[:minitest][:ignore_recipes] = [] default[:minitest][:verbose] = true +default[:minitest][:path] = '/var/chef/minitest' -case node[:os] +case node['os'] when 'windows' - default[:minitest][:path] = '/var/chef/minitest' # Usin nil to prevent this from being applied on Windows default[:minitest][:owner] = nil default[:minitest][:group] = nil default[:minitest][:mode] = nil else # Default values for Linux - default[:minitest][:path] = '/var/chef/minitest' default[:minitest][:owner] = 'root' default[:minitest][:group] = 'root' default[:minitest][:mode] = '0775' diff --git a/.kitchen.yml b/kitchen.yml similarity index 81% rename from .kitchen.yml rename to kitchen.yml index 2246bc8..6d19fbf 100644 --- a/.kitchen.yml +++ b/kitchen.yml @@ -23,27 +23,25 @@ provisioner: require_chef_omnibus: <%= omnibus_version %> platforms: -- name: ubuntu-12.04 +- name: ubuntu-20.04 driver_config: <% if driver == 'vagrant' %> - box: opscode-ubuntu-12.04 - box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box + box: bento/ubuntu-20.04 <% elsif driver == 'digitalocean' %> - image_id: 284203 + image: ubuntu-20 <% elsif driver == 'docker' %> - image: ubuntu:12.04 + image: ubuntu:20.04 <% end %> -- name: centos-6 +- name: centos-8 driver_config: <% if driver == 'vagrant' %> - box: opscode-centos-6.4 - box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box + box: bento/centos-8 <% elsif driver == 'digitalocean' %> - image_id: 562354 + image: centos-8 <% elsif driver == 'docker' %> - image: centos:6.6 + image: centos:8 <% end %> suites: @@ -54,6 +52,7 @@ suites: - recipe[minitest-handler_test1::not_default] - recipe[minitest-handler_test1::wrong_dir] - recipe[minitest-handler_test1::gh67] + - recipe[minitest-handler_test1::gh93] - name: legacy_paths run_list: diff --git a/libraries/rspec_hack.rb b/libraries/rspec_hack.rb new file mode 100644 index 0000000..7fa97d1 --- /dev/null +++ b/libraries/rspec_hack.rb @@ -0,0 +1,41 @@ +# In Chef 17, inspec requires rspec which adds describe methods that replace the minitest ones. +# We need to put them back + +module MinitestHandler + module RSpecHack + class << self + attr_accessor :main + end + + def fix_describe + return if Gem::Version.new(Chef::VERSION) < Gem::Version.new('17') + + # chef will also do this, but we want to make sure it's required now + require 'inspec' + RSpec.configure(&:disable_monkey_patching!) + + [(class << MinitestHandler::RSpecHack.main; self; end), Module].each do |klass| + klass.class_exec do + # describe method based on the one in minitest/spec + # https://github.com/seattlerb/minitest/blob/v4.7.3/lib/minitest/spec.rb#L59-L74 + def describe(desc, additional_desc = nil, &block) + stack = MiniTest::Spec.describe_stack + name = [stack.last, desc, additional_desc].compact.join('::') + sclas = stack.last || is_a?(Class) && is_a?(MiniTest::Spec::DSL) ? self : MiniTest::Spec.spec_type(desc) + + cls = sclas.create name, desc + + stack.push cls + cls.class_eval(&block) + stack.pop + cls + end + end + end + end + + extend self + end +end + +MinitestHandler::RSpecHack.main = self diff --git a/libraries/test_loader.rb b/libraries/test_loader.rb index 157c823..42df62c 100644 --- a/libraries/test_loader.rb +++ b/libraries/test_loader.rb @@ -21,14 +21,14 @@ def load_tests unless matches_filter?(recipe_name, cookbook_name) ::Chef::Log.debug('Not copying test files for recipe' \ " #{recipe_name} in cookbook #{cookbook_name} as it" \ - " does not match filter #{node[:minitest][:filter]}") + " does not match filter #{node['minitest']['filter']}") next end if matches_ignore?(recipe_name, cookbook_name) ::Chef::Log.info('Not copying test files for recipe' \ " #{recipe_name} in cookbook #{cookbook_name} as it" \ - " is not contained in #{node[:minitest][:ignore_recipes]}") + " is not contained in #{node['minitest']['ignore_recipes']}") next end @@ -38,7 +38,7 @@ def load_tests # create the parent directory dir = Chef::Resource::Directory.new( - "#{node[:minitest][:path]}/#{cookbook_name}", run_context) + "#{node['minitest']['path']}/#{cookbook_name}", run_context) dir.recursive(true) dir.run_action(:create) @@ -58,14 +58,16 @@ def load_tests end def register_handler + require 'minitest-chef-handler' + options = { - path: "#{node[:minitest][:path]}/#{node[:minitest][:tests]}", - verbose: node[:minitest][:verbose] } + path: "#{node['minitest']['path']}/#{node['minitest']['tests']}", + verbose: node['minitest']['verbose'] } # The following options can be omited - options[:filter] = node[:minitest][:filter] if node[:minitest].include? 'filter' - options[:seed] = node[:minitest][:seed] if node[:minitest].include? 'seed' - options[:ci_reports] = node[:minitest][:ci_reports] if node[:minitest].include? 'ci_reports' + options[:filter] = node['minitest']['filter'] if node['minitest'].include? 'filter' + options[:seed] = node['minitest']['seed'] if node['minitest'].include? 'seed' + options[:ci_reports] = node['minitest']['ci_reports'] if node['minitest'].include? 'ci_reports' handler = MiniTest::Chef::Handler.new(options) @@ -85,17 +87,17 @@ def register_handler def matches_filter?(recipe_name, cookbook_name) full_name = "recipe::#{cookbook_name}::#{recipe_name}" # If no filter is set, it will match all - filter = node[:minitest][:filter] || '/./' + filter = node['minitest']['filter'] || '/./' if filter.class == String # We don't know what form the user might give # us the pattern in. They may including leading and # trailing slashes, or they might just give us a # string. Try to handle both variations - if filter =~ %r{/(.*)/} - filter = Regexp.new(Regexp.last_match[1]) - else - filter = Regexp.new(filter) - end + filter = if filter =~ %r{/(.*)/} + Regexp.new(Regexp.last_match[1]) + else + Regexp.new(filter) + end end return true if full_name =~ filter false @@ -107,7 +109,7 @@ def matches_filter?(recipe_name, cookbook_name) # @returns [Boolean] def matches_ignore?(recipe_name, cookbook_name) full_name = "#{cookbook_name}::#{recipe_name}" - node[:minitest][:ignore_recipes].include? full_name + node['minitest']['ignore_recipes'].include? full_name end # Collect a list of recipes that we care about @@ -115,19 +117,14 @@ def matches_ignore?(recipe_name, cookbook_name) # @return [Array] of recipes that should be tested def seen_recipes recipe_list = [] - if node[:minitest][:recipes].empty? - if Chef::VERSION < '11.0' - seen_recipes = node.run_state[:seen_recipes] - recipe_list = seen_recipes.keys.each { |i| i } - else - recipe_list = run_context.loaded_recipes - end + if node['minitest']['recipes'].empty? + recipe_list = run_context.loaded_recipes if recipe_list.empty? && Chef::Config[:solo] # If you have roles listed in your run list they are NOT expanded recipe_list = node.run_list.map { |item| item.name if item.type == :recipe } end else - recipe_list = node[:minitest][:recipes].dup + recipe_list = node['minitest']['recipes'].dup end recipe_list end @@ -137,7 +134,7 @@ def seen_recipes # # @returns [Nil] def copy_file(cookbook_name, file_path) - base_path = ::File.join(node[:minitest][:path], cookbook_name) + base_path = ::File.join(node['minitest']['path'], cookbook_name) full_path = ::File.join(base_path, file_path) # Historically there has not been a one-to-one parity between diff --git a/metadata.rb b/metadata.rb index 6665fb6..c557b60 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,16 +1,14 @@ name 'minitest-handler' maintainer 'David Petzel' maintainer_email 'davidpetzel@gmail.com' -source_url 'https://github.com/btm/minitest-handler-cookbook' if respond_to?(:source_url) -issues_url 'https://github.com/btm/minitest-handler-cookbook/issues' if respond_to?(:issues_url) +source_url 'https://github.com/btm/minitest-handler-cookbook' +issues_url 'https://github.com/btm/minitest-handler-cookbook/issues' license 'Apache-2.0' description 'Installs and configures minitest-chef-handler' -long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '1.5.1' -%w(ubuntu centos).each do |os| - supports os -end -chef_version '>= 10.0' if respond_to?(:chef_version) +supports 'ubuntu' +supports 'centos' +chef_version '>= 14' -depends 'chef_handler' +gem 'minitest-chef-handler', '~> 1.1.0' diff --git a/recipes/default.rb b/recipes/default.rb index de2f98d..8856b76 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,46 +1,11 @@ ::Chef::Resource::RubyBlock.send(:include, MinitestHandler::CookbookHelper) -chef_gem 'ci_reporter' do - version node[:minitest][:ci_reporter_gem_version] - action :nothing - compile_time true if Chef::Resource::ChefGem.method_defined?(:compile_time) -end.run_action(:install) - -# Hack to install Gem immediately pre Chef 0.10.10 (CHEF-2879) -chef_gem 'minitest' do - version node[:minitest][:gem_version] - action :nothing - only_if { Chef::VERSION.to_f < 10.10 } - compile_time true if Chef::Resource::ChefGem.method_defined?(:compile_time) -end.run_action(:install) - -chef_gem 'minitest-chef-handler' do - version node[:minitest][:chef_handler_gem_version] - if node[:minitest][:chef_handler_gem_source] - options "--source #{node[:minitest][:chef_handler_gem_source]}" - end - compile_time true if Chef::Resource::ChefGem.method_defined?(:compile_time) - action :nothing - # I won't pretend I understand WHY this works, but since the release of - # Chef 11.8, this was causing errors related to the PUMA Gem - # http://lists.opscode.com/sympa/arc/chef/2013-10/msg00592.html - # I tried using the conservative flag, as well as a few other hacks - # but for whatever reason, simply retrying once works. The initial - # attempt still fails with the error in that thread, however - # the retry succeeds... - retries 1 -end.run_action(:install) - -Gem.clear_paths -# Ensure minitest gem is utilized -require 'minitest-chef-handler' - [:delete, :create].each do |action| directory "#{action} minitest test location" do - path node[:minitest][:path] - owner node[:minitest][:owner] - group node[:minitest][:group] - mode node[:minitest][:mode] + path node['minitest']['path'] + owner node['minitest']['owner'] + group node['minitest']['group'] + mode node['minitest']['mode'] recursive true action action end @@ -53,3 +18,9 @@ register_handler end end + +Chef.event_handler do + on :converge_start do + MinitestHandler::RSpecHack.fix_describe + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 376065f..202fea8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,4 @@ +require 'thor' require 'chefspec' require 'chefspec/berkshelf' @@ -11,7 +12,5 @@ # Specify platform and version for ChefSpec config.platform = 'ubuntu' - config.version = '12.04' + config.version = '20.04' end - -at_exit { ChefSpec::Coverage.report! } diff --git a/spec/unit/default_spec.rb b/spec/unit/default_spec.rb index 850da37..9729734 100644 --- a/spec/unit/default_spec.rb +++ b/spec/unit/default_spec.rb @@ -3,22 +3,6 @@ describe 'minitest-handler::default' do let(:chef_run) { ChefSpec::ServerRunner.new.converge(described_recipe) } - it 'installs minitest gem' do - expect(chef_run).to install_chef_gem('minitest-chef-handler').at_compile_time - end - - it 'installs ci_reporter gem' do - expect(chef_run).to install_chef_gem('ci_reporter').at_compile_time - end - - it 'installs minitest gem only before Chef 10.10' do - if Chef::VERSION.to_f < 10.10 - expect(chef_run).to install_chef_gem('minitest').at_compile_time - else - expect(chef_run).to_not install_chef_gem('minitest') - end - end - it 'deletes old test file directories' do expect(chef_run).to delete_directory( 'delete minitest test location').with(path: '/var/chef/minitest') diff --git a/spec/unit/test_loader_spec.rb b/spec/unit/test_loader_spec.rb index 31eab49..1cedc70 100644 --- a/spec/unit/test_loader_spec.rb +++ b/spec/unit/test_loader_spec.rb @@ -17,7 +17,7 @@ ::File.join(@base_files_path, 'tests', 'minitest', 'default_test.rb'), # Also test variations of relative paths starting at cookbook root ::File.join('files', 'default', 'tests', 'minitest', 'default_test.rb'), - ::File.join('files', 'default', 'test', 'default_test.rb') + ::File.join('files', 'default', 'test', 'default_test.rb'), ] ) expect(dummy_class.new.send(:cookbook_file_names, 'cookbook_name')[0]).to eq( diff --git a/test/cookbooks/minitest-handler_test1/files/default/test/gh93_test.rb b/test/cookbooks/minitest-handler_test1/files/default/test/gh93_test.rb new file mode 100644 index 0000000..1f7176b --- /dev/null +++ b/test/cookbooks/minitest-handler_test1/files/default/test/gh93_test.rb @@ -0,0 +1,16 @@ +# Create one recipe-name_test.rb file for each recipe to be tested. +require File.expand_path('helpers', File.dirname(__FILE__)) + +# For your own cookbooks, describe mycookbookname::default +describe 'minitest-handler_test1::gh93' do + # Helpers::MinitestHandler library is defined at + # #{cookbook_root}/files/default/tests/minitest/support/helpers.rb + # For each cookbook, rename library to Helpers::MyCookbookName + # in this file and in helpers.rb + include Helpers::MinitestHandler + + # For test examples, see: http://bit.ly/1sJO1oC + it 'creates a file' do + File.open('/tmp/gh93.txt', 'w') { |f| f.puts 'gh93' } + end +end diff --git a/test/cookbooks/minitest-handler_test1/metadata.rb b/test/cookbooks/minitest-handler_test1/metadata.rb index e6d2fb6..33873be 100644 --- a/test/cookbooks/minitest-handler_test1/metadata.rb +++ b/test/cookbooks/minitest-handler_test1/metadata.rb @@ -1,8 +1,6 @@ name 'minitest-handler_test1' maintainer 'Bryan Berry' maintainer_email 'bryan.berry@gmail.com' -license 'Apache 2.0' +license 'Apache-2.0' description 'Installs and configures minitest-chef-handler' version '0.0.1' - -%w(chef_handler minitest-handler).each { |ckbk| depends ckbk } diff --git a/test/cookbooks/minitest-handler_test1/recipes/gh93.rb b/test/cookbooks/minitest-handler_test1/recipes/gh93.rb new file mode 100644 index 0000000..e69de29 diff --git a/test/cookbooks/minitest-handler_test2/metadata.rb b/test/cookbooks/minitest-handler_test2/metadata.rb index 0c80f56..531da98 100644 --- a/test/cookbooks/minitest-handler_test2/metadata.rb +++ b/test/cookbooks/minitest-handler_test2/metadata.rb @@ -1,8 +1,6 @@ name 'minitest-handler_test2' maintainer 'Bryan Berry' maintainer_email 'bryan.berry@gmail.com' -license 'Apache 2.0' +license 'Apache-2.0' description 'Installs and configures minitest-chef-handler' version '0.0.1' - -%w(chef_handler minitest-handler).each { |ckbk| depends ckbk } diff --git a/test/integration/default/bats/default.bats b/test/integration/default/bats/default.bats index cc4ee03..a6b9a56 100755 --- a/test/integration/default/bats/default.bats +++ b/test/integration/default/bats/default.bats @@ -36,3 +36,7 @@ @test "does not copy not_run_gh67 test" { [ ! -f "/var/chef/minitest/minitest-handler_test1/not_run_gh67_test.rb" ] } + +@test "it creates a file when running gh93 test" { + [ -f "/tmp/gh93.txt" ] +} diff --git a/test/support/Gemfile b/test/support/Gemfile index fc28ed8..6192591 100644 --- a/test/support/Gemfile +++ b/test/support/Gemfile @@ -1,4 +1,3 @@ source 'https://rubygems.org' gem 'rake' -gem 'foodcritic', :platforms => :ruby_19