provider/virtualbox: fix NFS tests on Windows

This commit is contained in:
Mitchell Hashimoto 2014-01-15 11:48:07 -08:00
parent e2ec46bb4d
commit 35a19f829c
2 changed files with 19 additions and 20 deletions

View File

@ -58,7 +58,7 @@ module Vagrant
# This expands the path and ensures proper casing of each part
# of the path.
def fs_real_path(path)
def fs_real_path(path, **opts)
path = Pathname.new(File.expand_path(path))
if path.exist? && !fs_case_sensitive?

View File

@ -1,31 +1,27 @@
require_relative "../base"
require "vagrant/util/platform"
describe VagrantPlugins::ProviderVirtualBox::Action::PrepareNFSSettings do
include_context "unit"
include_context "virtualbox"
let(:machine) {
environment = Vagrant::Environment.new
provider = :virtualbox
provider_cls, provider_options = Vagrant.plugin("2").manager.providers[provider]
provider_config = Vagrant.plugin("2").manager.provider_configs[provider]
let(:iso_env) do
# We have to create a Vagrantfile so there is a root path
env = isolated_environment
env.vagrantfile("")
env.create_vagrant_env
end
Vagrant::Machine.new(
'test_machine',
provider,
provider_cls,
provider_config,
provider_options,
environment.config_global,
Pathname('data_dir'),
double('box'),
environment
)
}
let(:machine) do
iso_env.machine(iso_env.machine_names[0], :dummy).tap do |m|
m.provider.stub(driver: driver)
end
end
let(:env) {{ machine: machine }}
let(:app) { lambda { |*args| }}
let(:driver) { env[:machine].provider.driver }
let(:driver) { double("driver") }
subject { described_class.new(app, env) }
@ -41,7 +37,10 @@ describe VagrantPlugins::ProviderVirtualBox::Action::PrepareNFSSettings do
context "with an nfs synced folder" do
before do
env[:machine].config.vm.synced_folder("/host/path", "/guest/path", nfs: true)
# We can't be on Windows, because NFS gets disabled on Windows
Vagrant::Util::Platform.stub(windows?: false)
env[:machine].config.vm.synced_folder("/host/path", "/guest/path", type: "nfs")
env[:machine].config.finalize!
# Stub out the stuff so it just works by default