2013-11-22 01:38:17 +00:00
|
|
|
require "vagrant"
|
|
|
|
require Vagrant.source_root.join("test/unit/base")
|
|
|
|
|
2014-04-11 01:26:19 +00:00
|
|
|
require Vagrant.source_root.join("plugins/providers/virtualbox/config")
|
2013-11-22 01:38:17 +00:00
|
|
|
require Vagrant.source_root.join("plugins/providers/virtualbox/synced_folder")
|
|
|
|
|
|
|
|
describe VagrantPlugins::ProviderVirtualBox::SyncedFolder do
|
|
|
|
let(:machine) do
|
|
|
|
double("machine").tap do |m|
|
2017-08-04 17:10:58 +00:00
|
|
|
allow(m).to receive(:provider_config).and_return(VagrantPlugins::ProviderVirtualBox::Config.new)
|
|
|
|
allow(m).to receive(:provider_name).and_return(:virtualbox)
|
2013-11-22 01:38:17 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
subject { described_class.new }
|
|
|
|
|
2014-04-11 01:26:19 +00:00
|
|
|
before do
|
|
|
|
machine.provider_config.finalize!
|
|
|
|
end
|
|
|
|
|
2013-11-22 01:38:17 +00:00
|
|
|
describe "usable" do
|
|
|
|
it "should be with virtualbox provider" do
|
2017-08-04 17:10:58 +00:00
|
|
|
allow(machine).to receive(:provider_name).and_return(:virtualbox)
|
2014-03-14 15:02:07 +00:00
|
|
|
expect(subject).to be_usable(machine)
|
2013-11-22 01:38:17 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it "should not be with another provider" do
|
2017-08-04 17:10:58 +00:00
|
|
|
allow(machine).to receive(:provider_name).and_return(:vmware_fusion)
|
2014-03-14 15:02:07 +00:00
|
|
|
expect(subject).not_to be_usable(machine)
|
2013-11-22 01:38:17 +00:00
|
|
|
end
|
2014-04-11 01:26:19 +00:00
|
|
|
|
|
|
|
it "should not be usable if not functional vboxsf" do
|
|
|
|
machine.provider_config.functional_vboxsf = false
|
|
|
|
expect(subject).to_not be_usable(machine)
|
|
|
|
end
|
2013-11-22 01:38:17 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "prepare" do
|
|
|
|
let(:driver) { double("driver") }
|
|
|
|
|
|
|
|
before do
|
2017-08-04 17:10:58 +00:00
|
|
|
allow(machine).to receive(:driver).and_return(driver)
|
2013-11-22 01:38:17 +00:00
|
|
|
end
|
|
|
|
|
2017-04-06 21:57:46 +00:00
|
|
|
it "should share the folders"
|
2013-11-22 01:38:17 +00:00
|
|
|
end
|
|
|
|
end
|