From 90446142d9b5e1e0c21e98434e5ff0515a2782ad Mon Sep 17 00:00:00 2001 From: Gael Chamoulaud Date: Fri, 3 Apr 2015 15:10:59 +0200 Subject: [PATCH] Fix some missing rspec3 keywords - 'should' keyword should be changed in 'is_expected.to' Change-Id: I4ac85551285058fb50ba66e12c6b0d0982ff8485 Signed-off-by: Gael Chamoulaud --- spec/classes/ceilometer_agent_polling_spec.rb | 24 +++++++++---------- spec/classes/ceilometer_api_spec.rb | 20 ++++++++-------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/spec/classes/ceilometer_agent_polling_spec.rb b/spec/classes/ceilometer_agent_polling_spec.rb index 2892146..c729031 100644 --- a/spec/classes/ceilometer_agent_polling_spec.rb +++ b/spec/classes/ceilometer_agent_polling_spec.rb @@ -21,30 +21,30 @@ describe 'ceilometer::agent::polling' do shared_examples_for 'ceilometer-polling' do - it { should contain_class('ceilometer::params') } + it { is_expected.to contain_class('ceilometer::params') } context 'when compute_namespace => true' do it 'adds ceilometer user to nova group and, if required, to libvirt group' do if platform_params[:libvirt_group] - should contain_user('ceilometer').with_groups(['nova', "#{platform_params[:libvirt_group]}"]) + is_expected.to contain_user('ceilometer').with_groups(['nova', "#{platform_params[:libvirt_group]}"]) else - should contain_user('ceilometer').with_groups('nova') + is_expected.to contain_user('ceilometer').with_groups('nova') end end it 'ensures nova-common is installed before the package ceilometer-common' do - should contain_package('nova-common').with( + is_expected.to contain_package('nova-common').with( :before => /Package\[ceilometer-common\]/ ) end it 'configures nova notification driver' do - should contain_file_line_after('nova-notification-driver-common').with( + is_expected.to contain_file_line_after('nova-notification-driver-common').with( :line => 'notification_driver=nova.openstack.common.notifier.rpc_notifier', :path => '/etc/nova/nova.conf', :notify => 'Service[nova-compute]' ) - should contain_file_line_after('nova-notification-driver-ceilometer').with( + is_expected.to contain_file_line_after('nova-notification-driver-ceilometer').with( :line => 'notification_driver=ceilometer.compute.nova_notifier', :path => '/etc/nova/nova.conf', :notify => 'Service[nova-compute]' @@ -53,7 +53,7 @@ describe 'ceilometer::agent::polling' do end it 'installs ceilometer-polling package' do - should contain_package('ceilometer-polling').with( + is_expected.to contain_package('ceilometer-polling').with( :ensure => 'latest', :name => platform_params[:agent_package_name], :before => /Service\[ceilometer-polling\]/, @@ -62,11 +62,11 @@ describe 'ceilometer::agent::polling' do end it 'configures central agent' do - should contain_ceilometer_config('DEFAULT/polling_namespaces').with_value('central,compute,ipmi') + is_expected.to contain_ceilometer_config('DEFAULT/polling_namespaces').with_value('central,compute,ipmi') end it 'ensures ceilometer-common is installed before the service' do - should contain_package('ceilometer-common').with( + is_expected.to contain_package('ceilometer-common').with( :before => /Service\[ceilometer-polling\]/ ) end @@ -78,7 +78,7 @@ describe 'ceilometer::agent::polling' do end it 'configures ceilometer-polling service' do - should contain_service('ceilometer-polling').with( + is_expected.to contain_service('ceilometer-polling').with( :ensure => (params[:manage_service] && params[:enabled]) ? 'running' : 'stopped', :name => platform_params[:agent_service_name], :enable => params[:enabled], @@ -97,7 +97,7 @@ describe 'ceilometer::agent::polling' do end it 'configures ceilometer-polling service' do - should contain_service('ceilometer-polling').with( + is_expected.to contain_service('ceilometer-polling').with( :ensure => nil, :name => platform_params[:agent_service_name], :enable => false, @@ -108,7 +108,7 @@ describe 'ceilometer::agent::polling' do end it 'configures central agent' do - should contain_ceilometer_config('coordination/backend_url').with_value( params[:coordination_url] ) + is_expected.to contain_ceilometer_config('coordination/backend_url').with_value( params[:coordination_url] ) end end diff --git a/spec/classes/ceilometer_api_spec.rb b/spec/classes/ceilometer_api_spec.rb index 7b0c875..e54eea1 100644 --- a/spec/classes/ceilometer_api_spec.rb +++ b/spec/classes/ceilometer_api_spec.rb @@ -165,12 +165,12 @@ describe 'ceilometer::api' do }) end it 'configures identity_uri' do - should contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:1234/"); + is_expected.to contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:1234/"); # since only auth_uri is set the deprecated auth parameters should # still get set in case they are still in use - should contain_ceilometer_config('keystone_authtoken/auth_host').with_value('127.0.0.1'); - should contain_ceilometer_config('keystone_authtoken/auth_port').with_value('35357'); - should contain_ceilometer_config('keystone_authtoken/auth_protocol').with_value('http'); + is_expected.to contain_ceilometer_config('keystone_authtoken/auth_host').with_value('127.0.0.1'); + is_expected.to contain_ceilometer_config('keystone_authtoken/auth_port').with_value('35357'); + is_expected.to contain_ceilometer_config('keystone_authtoken/auth_protocol').with_value('http'); end end @@ -185,12 +185,12 @@ describe 'ceilometer::api' do }) end it 'configures identity_uri and auth_uri but deprecates old auth settings' do - should contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:35357/"); - should contain_ceilometer_config('keystone_authtoken/auth_uri').with_value("https://foo.bar:5000/v2.0/"); - should contain_ceilometer_config('keystone_authtoken/auth_admin_prefix').with(:ensure => 'absent') - should contain_ceilometer_config('keystone_authtoken/auth_port').with(:ensure => 'absent') - should contain_ceilometer_config('keystone_authtoken/auth_protocol').with(:ensure => 'absent') - should contain_ceilometer_config('keystone_authtoken/auth_host').with(:ensure => 'absent') + is_expected.to contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:35357/"); + is_expected.to contain_ceilometer_config('keystone_authtoken/auth_uri').with_value("https://foo.bar:5000/v2.0/"); + is_expected.to contain_ceilometer_config('keystone_authtoken/auth_admin_prefix').with(:ensure => 'absent') + is_expected.to contain_ceilometer_config('keystone_authtoken/auth_port').with(:ensure => 'absent') + is_expected.to contain_ceilometer_config('keystone_authtoken/auth_protocol').with(:ensure => 'absent') + is_expected.to contain_ceilometer_config('keystone_authtoken/auth_host').with(:ensure => 'absent') end end -- 2.45.2