Fix RSpec 3.x syntax

* 41 conversions
    from: it { should ... }
      to: it { is_expected.to ... }

* 5 conversions
    from: it { should_not ... }
      to: it { is_expected.to_not ... }

Change-Id: I143aec9fa309b4bbd664fa205b044131cfadc03b
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud 2015-09-14 09:52:06 +02:00
parent 13f29975a6
commit e005145df1
5 changed files with 46 additions and 46 deletions

View File

@ -93,6 +93,6 @@ describe 'openstack_extras::auth_file' do
}
end
it { should contain_file('/tmp/openrc')}
it { is_expected.to contain_file('/tmp/openrc')}
end
end

View File

@ -34,19 +34,19 @@ describe 'openstack_extras::repo::debian::debian' do
{}.merge!(default_params)
end
it { should contain_apt__source('debian_wheezy').with(
it { is_expected.to contain_apt__source('debian_wheezy').with(
:location => 'http://archive.gplhost.com/debian',
:release => 'kilo',
:repos => 'main',
)}
it { should contain_apt__source('debian_wheezy_backports').with(
it { is_expected.to contain_apt__source('debian_wheezy_backports').with(
:location => 'http://archive.gplhost.com/debian',
:release => 'kilo-backports',
:repos => 'main'
)}
it { should contain_exec('installing gplhost-archive-keyring') }
it { is_expected.to contain_exec('installing gplhost-archive-keyring') }
end
describe 'with overridden release' do
@ -54,19 +54,19 @@ describe 'openstack_extras::repo::debian::debian' do
default_params.merge!({ :release => 'juno' })
end
it { should contain_apt__source('debian_wheezy').with(
it { is_expected.to contain_apt__source('debian_wheezy').with(
:location => 'http://archive.gplhost.com/debian',
:release => 'juno',
:repos => 'main',
)}
it { should contain_apt__source('debian_wheezy_backports').with(
it { is_expected.to contain_apt__source('debian_wheezy_backports').with(
:location => 'http://archive.gplhost.com/debian',
:release => 'juno-backports',
:repos => 'main'
)}
it { should contain_exec('installing gplhost-archive-keyring') }
it { is_expected.to contain_exec('installing gplhost-archive-keyring') }
end
describe 'when not managing wheezy repo' do
@ -74,7 +74,7 @@ describe 'openstack_extras::repo::debian::debian' do
default_params.merge!({ :manage_whz => false })
end
it { should_not contain_exec('installing gplhost-archive-keyring') }
it { is_expected.to_not contain_exec('installing gplhost-archive-keyring') }
end
describe 'with overridden source hash' do
@ -96,13 +96,13 @@ describe 'openstack_extras::repo::debian::debian' do
})
end
it { should contain_apt__source('debian_unstable').with(
it { is_expected.to contain_apt__source('debian_unstable').with(
:location => 'http://mymirror/debian/',
:release => 'unstable',
:repos => 'main'
)}
it { should contain_apt__source('puppetlabs').with(
it { is_expected.to contain_apt__source('puppetlabs').with(
:location => 'http://apt.puppetlabs.com',
:repos => 'main',
:release => 'wheezy',
@ -110,7 +110,7 @@ describe 'openstack_extras::repo::debian::debian' do
:key_server => 'pgp.mit.edu'
)}
it { should contain_exec('installing gplhost-archive-keyring') }
it { is_expected.to contain_exec('installing gplhost-archive-keyring') }
end
describe 'with overridden source default' do
@ -129,14 +129,14 @@ describe 'openstack_extras::repo::debian::debian' do
})
end
it { should contain_apt__source('debian_unstable').with(
it { is_expected.to contain_apt__source('debian_unstable').with(
:location => 'http://mymirror/debian/',
:release => 'unstable',
:repos => 'main',
:include_src => 'true'
)}
it { should contain_exec('installing gplhost-archive-keyring') }
it { is_expected.to contain_exec('installing gplhost-archive-keyring') }
end
end
end

View File

@ -35,13 +35,13 @@ describe 'openstack_extras::repo::debian::ubuntu' do
{}.merge!(default_params)
end
it { should contain_apt__source('ubuntu-cloud-archive').with(
it { is_expected.to contain_apt__source('ubuntu-cloud-archive').with(
:location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
:release => 'trusty-updates/kilo',
:repos => 'main',
)}
it { should contain_exec('installing ubuntu-cloud-keyring') }
it { is_expected.to contain_exec('installing ubuntu-cloud-keyring') }
end
@ -50,13 +50,13 @@ describe 'openstack_extras::repo::debian::ubuntu' do
default_params.merge!({ :release => 'juno' })
end
it { should contain_apt__source('ubuntu-cloud-archive').with(
it { is_expected.to contain_apt__source('ubuntu-cloud-archive').with(
:location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
:release => 'trusty-updates/juno',
:repos => 'main',
)}
it { should contain_exec('installing ubuntu-cloud-keyring') }
it { is_expected.to contain_exec('installing ubuntu-cloud-keyring') }
end
describe 'when not managing UCA' do
@ -64,7 +64,7 @@ describe 'openstack_extras::repo::debian::ubuntu' do
default_params.merge!({ :manage_uca => false })
end
it { should_not contain_exec('installing ubuntu-cloud-keyring') }
it { is_expected.to_not contain_exec('installing ubuntu-cloud-keyring') }
end
describe 'with overridden source hash' do
@ -86,13 +86,13 @@ describe 'openstack_extras::repo::debian::ubuntu' do
})
end
it { should contain_apt__source('local_mirror').with(
it { is_expected.to contain_apt__source('local_mirror').with(
:location => 'http://mymirror/ubuntu/',
:release => 'trusty',
:repos => 'main'
)}
it { should contain_apt__source('puppetlabs').with(
it { is_expected.to contain_apt__source('puppetlabs').with(
:location => 'http://apt.puppetlabs.com',
:release => 'trusty',
:repos => 'main',
@ -100,7 +100,7 @@ describe 'openstack_extras::repo::debian::ubuntu' do
:key_server => 'pgp.mit.edu'
)}
it { should contain_exec('installing ubuntu-cloud-keyring') }
it { is_expected.to contain_exec('installing ubuntu-cloud-keyring') }
end
describe 'with overridden source default' do
@ -119,14 +119,14 @@ describe 'openstack_extras::repo::debian::ubuntu' do
})
end
it { should contain_apt__source('local_mirror').with(
it { is_expected.to contain_apt__source('local_mirror').with(
:include_src => 'true',
:location => 'http://mymirror/ubuntu/',
:release => 'trusty',
:repos => 'main',
)}
it { should contain_exec('installing ubuntu-cloud-keyring') }
it { is_expected.to contain_exec('installing ubuntu-cloud-keyring') }
end
describe 'with overridden uca repo name' do
@ -134,7 +134,7 @@ describe 'openstack_extras::repo::debian::ubuntu' do
default_params.merge!({ :repo => 'proposed' })
end
it { should contain_apt__source('ubuntu-cloud-archive').with(
it { is_expected.to contain_apt__source('ubuntu-cloud-archive').with(
:location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
:release => 'trusty-proposed/kilo',
:repos => 'main',

View File

@ -49,7 +49,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
{}.merge!(default_params)
end
it { should contain_yumrepo('rdo-release').with(
it { is_expected.to contain_yumrepo('rdo-release').with(
:baseurl => "http://repos.fedorapeople.org/repos/openstack/openstack-kilo/el7/",
:descr => "OpenStack Kilo Repository",
:priority => 98,
@ -63,7 +63,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
# 'metalink' property is supported from Puppet 3.5
if Puppet.version.to_f >= 3.5
it { should contain_yumrepo('epel').with(
it { is_expected.to contain_yumrepo('epel').with(
:metalink => "https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=\$basearch",
:descr => 'Extra Packages for Enterprise Linux 7 - $basearch',
:gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7",
@ -75,7 +75,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
:notify => "Exec[yum_refresh]"
)}
else
it { should contain_yumrepo('epel').with(
it { is_expected.to contain_yumrepo('epel').with(
:baseurl => "https://download.fedoraproject.org/pub/epel/7/\$basearch",
:descr => 'Extra Packages for Enterprise Linux 7 - $basearch',
:gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7",
@ -88,7 +88,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
)}
end
it { should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Kilo').with(
it { is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Kilo').with(
:source => "puppet:///modules/openstack_extras/RPM-GPG-KEY-RDO-Kilo",
:owner => 'root',
:group => 'root',
@ -103,13 +103,13 @@ describe 'openstack_extras::repo::redhat::redhat' do
default_params.merge!({ :release => 'juno' })
end
it { should contain_yumrepo('rdo-release').with(
it { is_expected.to contain_yumrepo('rdo-release').with(
:baseurl => "http://repos.fedorapeople.org/repos/openstack/openstack-juno/epel-7/",
:descr => "OpenStack Juno Repository",
:gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Juno"
)}
it { should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Juno').with(
it { is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Juno').with(
:source => "puppet:///modules/openstack_extras/RPM-GPG-KEY-RDO-Juno"
)}
end
@ -131,7 +131,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
})
end
it { should contain_yumrepo('CentOS-Base').with(
it { is_expected.to contain_yumrepo('CentOS-Base').with(
:baseurl => "http://mymirror/$releasever/os/$basearch/",
:descr => "CentOS-$releasever - Base",
:enabled => '1',
@ -142,7 +142,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
:notify => "Exec[yum_refresh]"
)}
it { should contain_yumrepo('CentOS-Updates').with(
it { is_expected.to contain_yumrepo('CentOS-Updates').with(
:baseurl => "http://mymirror/$releasever/updates/$basearch/",
:descr => "CentOS-$releasever - Updates",
:enabled => '1',
@ -163,7 +163,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
})
end
it { should contain_yumrepo('rdo-release').with(
it { is_expected.to contain_yumrepo('rdo-release').with(
:baseurl => "http://repos.fedorapeople.org/repos/openstack/openstack-kilo/el7/",
:descr => "OpenStack Kilo Repository",
:gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Kilo",
@ -179,7 +179,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
})
end
it { should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Kilo').with(
it { is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Kilo').with(
:owner => "steve"
)}
end
@ -189,7 +189,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
default_params.merge!({ :manage_epel => false })
end
it { should_not contain_yumrepo('epel') }
it { is_expected.to_not contain_yumrepo('epel') }
end
describe 'with rdo management disabled' do
@ -197,7 +197,7 @@ describe 'openstack_extras::repo::redhat::redhat' do
default_params.merge!({ :manage_rdo => false })
end
it { should_not contain_yumrepo('rdo-release') }
it { is_expected.to_not contain_yumrepo('rdo-release') }
end
end
end

View File

@ -30,18 +30,18 @@ describe 'openstack_extras::pacemaker::service', :type => :define do
context 'with defaults' do
it 'should contain openstack_extras::pacemaker::service definition' do
should contain_openstack_extras__pacemaker__service(title).with(default_params)
is_expected.to contain_openstack_extras__pacemaker__service(title).with(default_params)
end
it 'should override existing service provider' do
should contain_service('foo-api').with(
is_expected.to contain_service('foo-api').with(
{
:provider => 'pacemaker'
})
end
it 'should create a pacemaker primitive' do
should contain_cs_primitive('p_foo-api').with(
is_expected.to contain_cs_primitive('p_foo-api').with(
{
'ensure' => default_params[:ensure],
'primitive_class' => default_params[:primitive_class],
@ -54,7 +54,7 @@ describe 'openstack_extras::pacemaker::service', :type => :define do
})
end
it 'should not create a cloned resource' do
should contain_cs_clone('p_foo-api-clone').with(
is_expected.to contain_cs_clone('p_foo-api-clone').with(
{
'ensure' => 'absent',
})
@ -75,7 +75,7 @@ describe 'openstack_extras::pacemaker::service', :type => :define do
let (:ocf_handler_path) { "#{params[:handler_root_path]}/#{ocf_handler_name}" }
it 'should create an OCF file' do
should contain_file("#{title}-ocf-file").with(
is_expected.to contain_file("#{title}-ocf-file").with(
{
'ensure' => 'present',
'path' => ocf_script_path,
@ -87,7 +87,7 @@ describe 'openstack_extras::pacemaker::service', :type => :define do
end
it 'should create a handler file' do
should contain_file("#{ocf_handler_name}").with(
is_expected.to contain_file("#{ocf_handler_name}").with(
{
'ensure' => 'present',
'path' => ocf_handler_path,
@ -115,7 +115,7 @@ describe 'openstack_extras::pacemaker::service', :type => :define do
}
it 'should create an OCF file from template' do
should contain_file("#{title}-ocf-file").with(
is_expected.to contain_file("#{title}-ocf-file").with(
{
'path' => ocf_script_path,
'mode' => '0755',
@ -125,11 +125,11 @@ describe 'openstack_extras::pacemaker::service', :type => :define do
end
it 'should not create a handler file' do
should_not contain_file("#{params[:ocf_handler_name]}")
is_expected.to_not contain_file("#{params[:ocf_handler_name]}")
end
it 'should create a pacemaker primitive' do
should contain_cs_primitive('p_foo-api').with(
is_expected.to contain_cs_primitive('p_foo-api').with(
{
'ensure' => params[:ensure],
'primitive_class' => params[:primitive_class],
@ -151,7 +151,7 @@ describe 'openstack_extras::pacemaker::service', :type => :define do
})
end
it 'should create a cloned resource' do
should contain_cs_clone('p_foo-api-clone').with(
is_expected.to contain_cs_clone('p_foo-api-clone').with(
{
'ensure' => 'present',
'primitive' => 'p_foo-api',