Update spec files to be rubocop compliant
- Update .rubocop.yml to include spec/** - Update spec files to be rubocop compliant - Inlcude 'chefspec/berkshelf' in spec_helper.rb for ease of use Change-Id: Ief01cc34cc4f9f04e6ba6437f67bfd347975c3a8 Addresses: blueprint rubocop-for-network
This commit is contained in:
parent
7d94a7989a
commit
f5f4773b7a
|
@ -3,11 +3,11 @@ AllCops:
|
|||
- Gemfile
|
||||
- metadata.rb
|
||||
- attributes/**
|
||||
- spec/**
|
||||
|
||||
Excludes:
|
||||
- files/**
|
||||
- recipes/**
|
||||
- spec/**
|
||||
- templates/**
|
||||
|
||||
# UTF-8 headers not generally in these files
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue