Merge "Replace mocha by rspec-mocks"
This commit is contained in:
commit
0ca65d22c5
@ -13,6 +13,8 @@ RSpec.configure do |c|
|
||||
|
||||
c.module_path = File.join(fixture_path, 'modules')
|
||||
c.manifest_dir = File.join(fixture_path, 'manifests')
|
||||
|
||||
c.mock_with :rspec
|
||||
end
|
||||
|
||||
at_exit { RSpec::Puppet::Coverage.report! }
|
||||
|
@ -35,9 +35,9 @@ describe provider_class do
|
||||
|
||||
describe "self.instances" do
|
||||
it 'lists datastores' do
|
||||
provider_class.expects(:openstack)
|
||||
expect(provider_class).to receive(:openstack)
|
||||
.with('datastore', 'list', '--quiet', '--format', 'csv', [])
|
||||
.returns('"ID","Name"
|
||||
.and_return('"ID","Name"
|
||||
"1275b24c-73af-4c51-98ec-c9938a94a153","store1"
|
||||
"18088802-efe2-42f8-ac85-ecfddd37d24e","store2"
|
||||
')
|
||||
@ -52,13 +52,13 @@ describe provider_class do
|
||||
|
||||
describe '#create' do
|
||||
it 'creates datastore' do
|
||||
provider.expects(:trove_manage)
|
||||
expect(provider).to receive(:trove_manage)
|
||||
.with(['trove-manage', 'datastore_update', datastore_name, "''"])
|
||||
.returns(0)
|
||||
.and_return(0)
|
||||
|
||||
provider.expects(:trove_manage)
|
||||
expect(provider).to receive(:trove_manage)
|
||||
.with(['trove-manage', 'datastore_update', datastore_name, "0.1"])
|
||||
.returns(0)
|
||||
.and_return(0)
|
||||
|
||||
provider.create
|
||||
end
|
||||
|
@ -49,10 +49,10 @@ describe provider_class do
|
||||
|
||||
describe '#create' do
|
||||
it 'should call trove-manage' do
|
||||
provider.expects(:trove_manage).with(
|
||||
expect(provider). to receive(:trove_manage).with(
|
||||
['trove-manage', 'datastore_version_update', datastore_name,
|
||||
datastore_version, 'mysql', '1234', 'mysql', '1']
|
||||
).returns(0)
|
||||
).and_return(0)
|
||||
|
||||
provider.create
|
||||
end
|
||||
@ -60,10 +60,10 @@ describe provider_class do
|
||||
|
||||
describe '#exists' do
|
||||
it 'should list datastore versions' do
|
||||
provider_class.expects(:openstack)
|
||||
expect(provider_class).to receive(:openstack)
|
||||
.with('datastore version', 'list', '--quiet', '--format', 'csv',
|
||||
datastore_name)
|
||||
.returns('"ID","Name","Version"
|
||||
.and_return('"ID","Name","Version"
|
||||
"9c4d3fb1-644c-4543-9c37-49b3a801b66c","5.7.29","5.7.29"
|
||||
"406b75fb-0727-4923-a702-d677e3fd84ab","5.7.30","5.7.30"
|
||||
')
|
||||
|
Loading…
Reference in New Issue
Block a user