puppet-trove/spec/unit/provider/trove_datastore_version/trove_spec.rb
Sebastien Badia 4aa993d435 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
2015-04-28 03:33:03 +02:00

51 lines
1.1 KiB
Ruby

require 'puppet'
require 'spec_helper'
require 'puppet/provider/trove_datastore_version/trove'
provider_class = Puppet::Type.type(:trove_datastore_version).provider(:trove)
describe provider_class do
let :datastore_name do
'foo'
end
let :datastore_version do
'1.0'
end
let :resource do
Puppet::Type::Trove_datastore_version.new({
:name => datastore_version,
:ensure => 'present',
:datastore => datastore_name,
:manager => 'mysql',
:image_id => '1234',
:packages => 'mysql',
:active => 1
})
end
let :provider do
described_class.new(resource)
end
describe "self.instances" do
it "should have an instances method" do
expect(provider.class).to respond_to(:instances)
end
end
describe '#create' do
it 'should call trove-manage' do
provider.expects(:trove_manage).with(
['trove-manage', 'datastore_version_update', datastore_name, "1.0",
'mysql', '1234', 'mysql', '1']
).returns(0)
provider.create
end
end
end