]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
Fix some missing rspec3 keywords
authorGael Chamoulaud <gchamoul@redhat.com>
Fri, 3 Apr 2015 13:10:59 +0000 (15:10 +0200)
committerGael Chamoulaud <gchamoul@redhat.com>
Fri, 3 Apr 2015 13:10:59 +0000 (15:10 +0200)
- 'should' keyword should be changed in 'is_expected.to'

Change-Id: I4ac85551285058fb50ba66e12c6b0d0982ff8485
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
spec/classes/ceilometer_agent_polling_spec.rb
spec/classes/ceilometer_api_spec.rb

index 289214689a6598cb60973c6ba1fb854b901347df..c729031d2dc4c59f8f30b2378fed5754bcf0cb4f 100644 (file)
@@ -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
index 7b0c87500c55071649e7d8a7babc7ed17f2a6057..e54eea1a9dac04b2782bc957ba250fb019f552b4 100644 (file)
@@ -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