add unit tests to validate

This commit is contained in:
Zachary Flower 2017-12-14 15:25:24 -07:00
parent 4a4183398b
commit 0f4c06f7ba
1 changed files with 14 additions and 0 deletions

View File

@ -70,6 +70,20 @@ describe VagrantPlugins::ProviderVirtualBox::Action::Network do
}])
end
it "raises the appropriate error when provided with an invalid IP address" do
guest = double("guest")
machine.config.vm.network 'private_network', { ip: '192.168.33.06' }
expect{ subject.call(env) }.to raise_error(Vagrant::Errors::NetworkAddressInvalid)
end
it "raises no invalid network error when provided with a valid IP address" do
guest = double("guest")
machine.config.vm.network 'private_network', { ip: '192.168.33.6' }
expect{ subject.call(env) }.not_to raise_error(Vagrant::Errors::NetworkAddressInvalid)
end
context "with a dhcp private network" do
let(:bridgedifs) { [] }
let(:hostonlyifs) { [] }