Skip to content

Commit 9044614

Browse files
committed
Fix some missing rspec3 keywords
- 'should' keyword should be changed in 'is_expected.to' Change-Id: I4ac85551285058fb50ba66e12c6b0d0982ff8485 Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
1 parent 8d17c36 commit 9044614

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

spec/classes/ceilometer_agent_polling_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,30 @@
2121

2222
shared_examples_for 'ceilometer-polling' do
2323

24-
it { should contain_class('ceilometer::params') }
24+
it { is_expected.to contain_class('ceilometer::params') }
2525

2626
context 'when compute_namespace => true' do
2727
it 'adds ceilometer user to nova group and, if required, to libvirt group' do
2828
if platform_params[:libvirt_group]
29-
should contain_user('ceilometer').with_groups(['nova', "#{platform_params[:libvirt_group]}"])
29+
is_expected.to contain_user('ceilometer').with_groups(['nova', "#{platform_params[:libvirt_group]}"])
3030
else
31-
should contain_user('ceilometer').with_groups('nova')
31+
is_expected.to contain_user('ceilometer').with_groups('nova')
3232
end
3333
end
3434

3535
it 'ensures nova-common is installed before the package ceilometer-common' do
36-
should contain_package('nova-common').with(
36+
is_expected.to contain_package('nova-common').with(
3737
:before => /Package\[ceilometer-common\]/
3838
)
3939
end
4040

4141
it 'configures nova notification driver' do
42-
should contain_file_line_after('nova-notification-driver-common').with(
42+
is_expected.to contain_file_line_after('nova-notification-driver-common').with(
4343
:line => 'notification_driver=nova.openstack.common.notifier.rpc_notifier',
4444
:path => '/etc/nova/nova.conf',
4545
:notify => 'Service[nova-compute]'
4646
)
47-
should contain_file_line_after('nova-notification-driver-ceilometer').with(
47+
is_expected.to contain_file_line_after('nova-notification-driver-ceilometer').with(
4848
:line => 'notification_driver=ceilometer.compute.nova_notifier',
4949
:path => '/etc/nova/nova.conf',
5050
:notify => 'Service[nova-compute]'
@@ -53,7 +53,7 @@
5353
end
5454

5555
it 'installs ceilometer-polling package' do
56-
should contain_package('ceilometer-polling').with(
56+
is_expected.to contain_package('ceilometer-polling').with(
5757
:ensure => 'latest',
5858
:name => platform_params[:agent_package_name],
5959
:before => /Service\[ceilometer-polling\]/,
@@ -62,11 +62,11 @@
6262
end
6363

6464
it 'configures central agent' do
65-
should contain_ceilometer_config('DEFAULT/polling_namespaces').with_value('central,compute,ipmi')
65+
is_expected.to contain_ceilometer_config('DEFAULT/polling_namespaces').with_value('central,compute,ipmi')
6666
end
6767

6868
it 'ensures ceilometer-common is installed before the service' do
69-
should contain_package('ceilometer-common').with(
69+
is_expected.to contain_package('ceilometer-common').with(
7070
:before => /Service\[ceilometer-polling\]/
7171
)
7272
end
@@ -78,7 +78,7 @@
7878
end
7979

8080
it 'configures ceilometer-polling service' do
81-
should contain_service('ceilometer-polling').with(
81+
is_expected.to contain_service('ceilometer-polling').with(
8282
:ensure => (params[:manage_service] && params[:enabled]) ? 'running' : 'stopped',
8383
:name => platform_params[:agent_service_name],
8484
:enable => params[:enabled],
@@ -97,7 +97,7 @@
9797
end
9898

9999
it 'configures ceilometer-polling service' do
100-
should contain_service('ceilometer-polling').with(
100+
is_expected.to contain_service('ceilometer-polling').with(
101101
:ensure => nil,
102102
:name => platform_params[:agent_service_name],
103103
:enable => false,
@@ -108,7 +108,7 @@
108108
end
109109

110110
it 'configures central agent' do
111-
should contain_ceilometer_config('coordination/backend_url').with_value( params[:coordination_url] )
111+
is_expected.to contain_ceilometer_config('coordination/backend_url').with_value( params[:coordination_url] )
112112
end
113113

114114
end

spec/classes/ceilometer_api_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@
165165
})
166166
end
167167
it 'configures identity_uri' do
168-
should contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:1234/");
168+
is_expected.to contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:1234/");
169169
# since only auth_uri is set the deprecated auth parameters should
170170
# still get set in case they are still in use
171-
should contain_ceilometer_config('keystone_authtoken/auth_host').with_value('127.0.0.1');
172-
should contain_ceilometer_config('keystone_authtoken/auth_port').with_value('35357');
173-
should contain_ceilometer_config('keystone_authtoken/auth_protocol').with_value('http');
171+
is_expected.to contain_ceilometer_config('keystone_authtoken/auth_host').with_value('127.0.0.1');
172+
is_expected.to contain_ceilometer_config('keystone_authtoken/auth_port').with_value('35357');
173+
is_expected.to contain_ceilometer_config('keystone_authtoken/auth_protocol').with_value('http');
174174
end
175175
end
176176

@@ -185,12 +185,12 @@
185185
})
186186
end
187187
it 'configures identity_uri and auth_uri but deprecates old auth settings' do
188-
should contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:35357/");
189-
should contain_ceilometer_config('keystone_authtoken/auth_uri').with_value("https://foo.bar:5000/v2.0/");
190-
should contain_ceilometer_config('keystone_authtoken/auth_admin_prefix').with(:ensure => 'absent')
191-
should contain_ceilometer_config('keystone_authtoken/auth_port').with(:ensure => 'absent')
192-
should contain_ceilometer_config('keystone_authtoken/auth_protocol').with(:ensure => 'absent')
193-
should contain_ceilometer_config('keystone_authtoken/auth_host').with(:ensure => 'absent')
188+
is_expected.to contain_ceilometer_config('keystone_authtoken/identity_uri').with_value("https://foo.bar:35357/");
189+
is_expected.to contain_ceilometer_config('keystone_authtoken/auth_uri').with_value("https://foo.bar:5000/v2.0/");
190+
is_expected.to contain_ceilometer_config('keystone_authtoken/auth_admin_prefix').with(:ensure => 'absent')
191+
is_expected.to contain_ceilometer_config('keystone_authtoken/auth_port').with(:ensure => 'absent')
192+
is_expected.to contain_ceilometer_config('keystone_authtoken/auth_protocol').with(:ensure => 'absent')
193+
is_expected.to contain_ceilometer_config('keystone_authtoken/auth_host').with(:ensure => 'absent')
194194
end
195195
end
196196

0 commit comments

Comments
 (0)