diff --git a/.rubocop.yml b/.rubocop.yml index 5e0be9f..253be24 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,3 @@ -inherit_from: .rubocop_todo.yml - AllCops: Include: - metadata.rb diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index c00e5cb..0000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config` -# on 2017-08-17 17:27:05 -0400 using RuboCop version 0.47.1. -# The point is for the user to remove these configuration records -# one by one as the offenses are removed from the code base. -# Note that changes in the inspected code, or installation of new -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 4 -# Configuration parameters: CountComments, ExcludedMethods. -Metrics/BlockLength: - Max: 107 - -# Offense count: 1 -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: nested, compact -Style/ClassAndModuleChildren: - Exclude: - - 'recipes/rabbitmq-server.rb' - -# Offense count: 1 -Style/Documentation: - Exclude: - - 'spec/**/*' - - 'test/**/*' - - 'recipes/rabbitmq-server.rb' diff --git a/Rakefile b/Rakefile index 676e7d4..c9edb13 100644 --- a/Rakefile +++ b/Rakefile @@ -1,20 +1,20 @@ task default: ["test"] -task :test => [:lint, :style, :unit] +task :test => [:syntax, :lint, :unit] desc "Vendor the cookbooks in the Berksfile" task :berks_prep do sh %{chef exec berks vendor} end -desc "Run FoodCritic (lint) tests" -task :lint do - sh %{chef exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .} +desc "Run FoodCritic (syntax) tests" +task :syntax do + sh %{chef exec foodcritic --exclude spec -f any .} end -desc "Run RuboCop (style) tests" -task :style do - sh %{chef exec rubocop} +desc "Run RuboCop (lint) tests" +task :lint do + sh %{chef exec cookstyle} end desc "Run RSpec (unit) tests" diff --git a/spec/rabbitmq-server_spec.rb b/spec/rabbitmq-server_spec.rb index d7f621c..5adb353 100644 --- a/spec/rabbitmq-server_spec.rb +++ b/spec/rabbitmq-server_spec.rb @@ -46,7 +46,7 @@ describe 'openstack-ops-messaging::rabbitmq-server' do describe 'cluster' do before do node.set['openstack']['mq'] = { - 'cluster' => true + 'cluster' => true, } end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 734a568..2fa8b0b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -8,17 +8,17 @@ LOG_LEVEL = :fatal REDHAT_OPTS = { platform: 'redhat', version: '7.1', - log_level: LOG_LEVEL + log_level: LOG_LEVEL, }.freeze UBUNTU_OPTS = { platform: 'ubuntu', version: '14.04', - log_level: LOG_LEVEL + log_level: LOG_LEVEL, }.freeze SUSE_OPTS = { platform: 'suse', version: '11.3', - log_level: ::LOG_LEVEL + log_level: ::LOG_LEVEL, }.freeze shared_context 'ops_messaging_stubs' do @@ -33,7 +33,7 @@ shared_context 'ops_messaging_stubs' do .with(:node, 'recipes:openstack-ops-messaging\\:\\:rabbitmq-server AND chef_environment:_default') .and_return [ { 'hostname' => 'host2' }, - { 'hostname' => 'host1' } + { 'hostname' => 'host1' }, ] allow_any_instance_of(Chef::Recipe).to receive(:get_password) .with('user', anything)