diff --git a/.rubocop.yml b/.rubocop.yml index 903ea48a..2c2b8b48 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,11 +3,11 @@ AllCops: - Gemfile - metadata.rb - attributes/** + - spec/** Excludes: - files/** - recipes/** - - spec/** - templates/** # UTF-8 headers not generally in these files diff --git a/spec/build_openvswitch_source_spec.rb b/spec/build_openvswitch_source_spec.rb index 1f7a52fb..eaa02827 100644 --- a/spec/build_openvswitch_source_spec.rb +++ b/spec/build_openvswitch_source_spec.rb @@ -17,7 +17,7 @@ describe 'openvswitch::build_openvswitch_source' do node.set['openstack']['compute']['network']['service_type'] = 'nova' chef_run.converge 'openstack-network::openvswitch' chef_run.converge 'openstack-network::build_openvswitch_source' - ['build-essential', 'pkg-config', 'fakeroot', 'libssl-dev', 'openssl', 'debhelper', 'autoconf'].each do |pkg| + %w(build-essential pkg-config fakeroot libssl-dev openssl debhelper autoconf).each do |pkg| expect(chef_run).to_not install_package pkg end end @@ -25,7 +25,7 @@ describe 'openvswitch::build_openvswitch_source' do # since our mocked version of ubuntu is precise, our compile # utilities should be installed to build OVS from source it 'installs openvswitch build dependencies' do - ['build-essential', 'pkg-config', 'fakeroot', 'libssl-dev', 'openssl', 'debhelper', 'autoconf'].each do |pkg| + %w(build-essential pkg-config fakeroot libssl-dev openssl debhelper autoconf).each do |pkg| expect(@chef_run).to install_package pkg end end diff --git a/spec/dhcp_agent_spec.rb b/spec/dhcp_agent_spec.rb index 32a7febe..71605c37 100644 --- a/spec/dhcp_agent_spec.rb +++ b/spec/dhcp_agent_spec.rb @@ -24,7 +24,7 @@ describe 'openstack-network::dhcp_agent' do # since our mocked version of ubuntu is precise, our compile # utilities should be installed to build dnsmasq it 'installs dnsmasq build dependencies' do - ['build-essential', 'pkg-config', 'libidn11-dev', 'libdbus-1-dev', 'libnetfilter-conntrack-dev', 'gettext'].each do |pkg| + %w(build-essential pkg-config libidn11-dev libdbus-1-dev libnetfilter-conntrack-dev gettext).each do |pkg| expect(@chef_run).to install_package pkg end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 74cd2379..21c7dc91 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,6 @@ # Encoding: utf-8 require 'chefspec' +require 'chefspec/berkshelf' require 'chef/application' ::LOG_LEVEL = :fatal @@ -44,7 +45,7 @@ MOCK_NODE_NETWORK_DATA = } } -def neutron_stubs +def neutron_stubs # rubocop:disable MethodLength ::Chef::Recipe.any_instance.stub(:rabbit_servers) .and_return('1.1.1.1:5672,2.2.2.2:5672') ::Chef::Recipe.any_instance.stub(:config_by_role) @@ -61,7 +62,7 @@ def neutron_stubs .with('secrets', 'neutron_metadata_secret') .and_return('metadata-secret') ::Chef::Recipe.any_instance.stub(:get_password) - .with('db', anything()) + .with('db', anything) .and_return('neutron') ::Chef::Recipe.any_instance.stub(:get_password) .with('service', 'openstack-network')