Replace mocha by rspec-mocks
puppetlabs_spec_helper recommends rspec-mocks instead of mocha[1] and
it uses rspec-mocks by default instead of mocha since v 5.0.0[2]
This is the prep work to adapt to that migration.
[1] https://github.com/puppetlabs/puppetlabs_spec_helper/#mock_with
[2] 493f0cbc1c
Closes-Bug: #2004135
Change-Id: I9056254a69cf58a4b30fefa246ace64042a70af7
This commit is contained in:
parent
d15fb87491
commit
a495b646be
@ -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! }
|
||||
|
@ -15,8 +15,8 @@ describe Puppet::Provider::Mistral do
|
||||
|
||||
it 'should fail if no auth params are passed and the mistral config file does not have the expected contents' do
|
||||
mock = {}
|
||||
Puppet::Util::IniConfig::File.expects(:new).returns(mock)
|
||||
mock.expects(:read).with('/etc/mistral/mistral.conf')
|
||||
expect(Puppet::Util::IniConfig::File).to receive(:new).and_return(mock)
|
||||
expect(mock).to receive(:read).with('/etc/mistral/mistral.conf')
|
||||
expect do
|
||||
klass.mistral_credentials
|
||||
end.to raise_error(Puppet::Error, /Mistral types will not work/)
|
||||
@ -39,8 +39,8 @@ describe Puppet::Provider::Mistral do
|
||||
'password' => 'password',
|
||||
}
|
||||
}
|
||||
Puppet::Util::IniConfig::File.expects(:new).returns(mock)
|
||||
mock.expects(:read).with('/etc/mistral/mistral.conf')
|
||||
expect(Puppet::Util::IniConfig::File).to receive(:new).and_return(mock)
|
||||
expect(mock).to receive(:read).with('/etc/mistral/mistral.conf')
|
||||
expect(klass.mistral_credentials).to eq(creds_hash)
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user