Allow the connection.client.libversion call (#1416)

When the tests are executed and rsync is not installed on the machine executing
the tests, then vagrant-libvirt will automatically fallback to virtiofs or
9p. Both of these perform the following call to check the libvirt version:

libvirt_version = machine.provider.driver.connection.client.libversion

However, this mock was not setup and thus those tests would fail.

This fixes https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1415
This commit is contained in:
Dan Čermák
2021-12-03 09:11:06 +01:00
committed by GitHub
parent 97e534b1e7
commit 5914f0cffd

View File

@@ -27,6 +27,8 @@ describe VagrantPlugins::ProviderLibvirt::Action do
allow(logger).to receive(:info) allow(logger).to receive(:info)
allow(logger).to receive(:debug) allow(logger).to receive(:debug)
allow(logger).to receive(:error) allow(logger).to receive(:error)
allow(connection.client).to receive(:libversion).and_return(6_002_000)
end end
def allow_action_env_result(action, *responses) def allow_action_env_result(action, *responses)