spec: updates for rspec-puppet 2.x and rspec 3.x

This patch aim to update our specs test in order to work with the rspec-puppet release
2.0.0, in the mean time, we update rspec syntax in order to be prepared
for rspec 3.x move.

In details:

  * Use shared_examples "a Puppet::Error" for puppet::error tests
  * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
  * Fix spec tests for rspec-puppet 2.0.0
  * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
  * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper)

Change-Id: Ibd0333dc3c0959e846edfbad51fb48e8dfb8fbe9
Card: https://trello.com/c/eHXc1Ryd/4-investigate-the-necessary-change-to-be-rspec-puppet-2-0-0-compliant
This commit is contained in:
Sebastien Badia
2015-02-25 05:37:44 +01:00
parent 0d83409381
commit dbe297b056
20 changed files with 288 additions and 293 deletions

View File

@@ -25,7 +25,7 @@ describe 'glance' do
let :params do param_set end
it { should contain_file('/etc/glance/').with(
it { is_expected.to contain_file('/etc/glance/').with(
'ensure' => 'directory',
'owner' => 'glance',
'mode' => '0770'
@@ -40,7 +40,7 @@ describe 'glance' do
end
let(:params) { default_params }
it { should_not contain_package('glance') }
it { is_expected.to_not contain_package('glance') }
end
describe 'on RedHat platforms' do
@@ -49,7 +49,7 @@ describe 'glance' do
end
let(:params) { default_params }
it { should contain_package('openstack-glance').with(
it { is_expected.to contain_package('openstack-glance').with(
:tag => ['openstack'],
)}
end