Fix spec tests for RSpec 3.x and Puppet 4.x

Rix resource array, according[1].
[1]https://github.com/puppetlabs/puppet/blob/3.7.5/lib/puppet/resource.rb#L446-L453

This patch also update RSpec 3.x matcher in order to remove deprecation
warnings (in units).

Change-Id: Ib05351a3897dfb6d8dc52f696b27440af40382bd
Closes-bug: #1447620
This commit is contained in:
Sebastien Badia 2015-04-28 03:25:17 +02:00
parent 0f435e71c2
commit dd235c92a8
3 changed files with 9 additions and 9 deletions

View File

@ -23,7 +23,7 @@ describe 'tuskar::keystone::auth' do
it { is_expected.to contain_keystone_user_role('tuskar@foobar').with(
:ensure => 'present',
:roles => 'admin'
:roles => ['admin']
)}
it { is_expected.to contain_keystone_service('tuskar').with(

View File

@ -22,8 +22,8 @@ describe provider_class do
{:name => 'DEFAULT/foo', :value => 'bar'}
)
provider = provider_class.new(resource)
provider.section.should == 'DEFAULT'
provider.setting.should == 'foo'
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
end
it 'should allow setting to be set explicitly' do
@ -31,7 +31,7 @@ describe provider_class do
{:name => 'dude/foo', :value => 'bar'}
)
provider = provider_class.new(resource)
provider.section.should == 'dude'
provider.setting.should == 'foo'
expect(provider.section).to eq('dude')
expect(provider.setting).to eq('foo')
end
end

View File

@ -29,19 +29,19 @@ describe 'Puppet::Type.type(:tuskar_config)' do
it 'should accept a valid value' do
@tuskar_config[:value] = 'bar'
@tuskar_config[:value].should == 'bar'
expect(@tuskar_config[:value]).to eq('bar')
end
it 'should not accept a value with whitespace' do
@tuskar_config[:value] = 'b ar'
@tuskar_config[:value].should == 'b ar'
expect(@tuskar_config[:value]).to eq('b ar')
end
it 'should accept valid ensure values' do
@tuskar_config[:ensure] = :present
@tuskar_config[:ensure].should == :present
expect(@tuskar_config[:ensure]).to eq(:present)
@tuskar_config[:ensure] = :absent
@tuskar_config[:ensure].should == :absent
expect(@tuskar_config[:ensure]).to eq(:absent)
end
it 'should not accept invalid ensure values' do