Update validation to look for if provider_config is empty not nil

This commit is contained in:
Brian Cain 2020-04-21 14:53:42 -07:00
parent be939fcb59
commit cf063c6e38
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
2 changed files with 5 additions and 2 deletions

View File

@ -184,7 +184,7 @@ module VagrantPlugins
end
end
if @provider_config
if !@provider_config.empty?
if !@provider_config.keys.include?(machine.provider_name)
machine.env.ui.warn(I18n.t("vagrant.config.disk.missing_provider",
machine: machine.name,

View File

@ -9,8 +9,11 @@ describe VagrantPlugins::Kernel_V2::VagrantConfigDisk do
subject { described_class.new(type) }
let(:ui) { double("ui") }
let(:env) { double("env", ui: ui) }
let(:provider) { double("provider") }
let(:machine) { double("machine", provider: provider, provider_name: :virtualbox) }
let(:machine) { double("machine", name: "name", provider: provider, env: env,
provider_name: :virtualbox) }
def assert_invalid