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: I562072a2169ada204616b86e0033ac4905579ed6
Closes-bug: #1447620
This commit is contained in:
Sebastien Badia 2015-04-28 03:33:03 +02:00
parent 25ad770479
commit 4aa993d435
5 changed files with 12 additions and 12 deletions

View File

@ -40,7 +40,7 @@ describe 'trove::keystone::auth' do
it { is_expected.to contain_keystone_user_role('trove@foobar').with(
:ensure => 'present',
:roles => 'admin'
:roles => ['admin']
)}
it { is_expected.to contain_keystone_service('trove').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

@ -30,12 +30,12 @@ describe provider_class do
describe "self.instances" do
it "should have an instances method" do
provider.class.should respond_to(:instances)
expect(provider.class).to respond_to(:instances)
end
it "should list instances" do
datastores = described_class.instances
datastores.size.should == 1
expect(datastores.size).to eq(1)
datastores.map {|provider| provider.name} == datastore_name
end
end

View File

@ -32,7 +32,7 @@ describe provider_class do
describe "self.instances" do
it "should have an instances method" do
provider.class.should respond_to(:instances)
expect(provider.class).to respond_to(:instances)
end
end

View File

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