Skip to content

Commit

Permalink
Fix some missing rspec3 keywords
Browse files Browse the repository at this point in the history
- 'should' keyword should be changed in 'is_expected.to'

Change-Id: I4ac85551285058fb50ba66e12c6b0d0982ff8485
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
  • Loading branch information
strider committed Apr 3, 2015
1 parent 8d17c36 commit 9044614
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
24 changes: 12 additions & 12 deletions spec/classes/ceilometer_agent_polling_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,30 @@

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]'
Expand All @@ -53,7 +53,7 @@
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\]/,
Expand All @@ -62,11 +62,11 @@
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
Expand All @@ -78,7 +78,7 @@
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],
Expand All @@ -97,7 +97,7 @@
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,
Expand All @@ -108,7 +108,7 @@
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
Expand Down
20 changes: 10 additions & 10 deletions spec/classes/ceilometer_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@
})
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

Expand All @@ -185,12 +185,12 @@
})
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

Expand Down

0 comments on commit 9044614

Please sign in to comment.