mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Validate partial mocks (#1417)
Switch to using explicit references to objects to be partially mocked and remove the need to resolve the string constants as this will catch more instances of calls to invalid or missing methods. Rework how the vm is added to the machine for one of the tests as it is not a method and instead is provided via internal state being exposed with a helper.
This commit is contained in:
@@ -607,7 +607,9 @@ describe VagrantPlugins::ProviderLibvirt::Config do
|
||||
|
||||
context 'with mac defined' do
|
||||
let (:vm) { double('vm') }
|
||||
before { expect(machine.config).to receive(:vm).and_return(vm) }
|
||||
before do
|
||||
machine.config.instance_variable_get("@keys")[:vm] = vm
|
||||
end
|
||||
|
||||
it 'is valid with valid mac' do
|
||||
expect(vm).to receive(:networks).and_return([[:public, { mac: 'aa:bb:cc:dd:ee:ff' }]])
|
||||
|
||||
Reference in New Issue
Block a user