diff --git a/plugins/hosts/null/host.rb b/plugins/hosts/null/host.rb new file mode 100644 index 000000000..b90b1503c --- /dev/null +++ b/plugins/hosts/null/host.rb @@ -0,0 +1,12 @@ +require "vagrant" + +module VagrantPlugins + module HostNull + class Host < Vagrant.plugin("2", :host) + def detect? + # This host can only be explicitly chosen. + false + end + end + end +end diff --git a/plugins/hosts/null/plugin.rb b/plugins/hosts/null/plugin.rb new file mode 100644 index 000000000..2c72912fb --- /dev/null +++ b/plugins/hosts/null/plugin.rb @@ -0,0 +1,15 @@ +require "vagrant" + +module VagrantPlugins + module HostNull + class Plugin < Vagrant.plugin("2") + name "null host" + description "A host that implements no capabilities." + + host("null") do + require_relative "host" + Host + end + end + end +end diff --git a/test/unit/base.rb b/test/unit/base.rb index db530c2e4..c9ffe6654 100644 --- a/test/unit/base.rb +++ b/test/unit/base.rb @@ -29,3 +29,11 @@ end # Configure VAGRANT_CWD so that the tests never find an actual # Vagrantfile anywhere, or at least this minimizes those chances. ENV["VAGRANT_CWD"] = Tempdir.new.path + +# Unset all host plugins so that we aren't executing subprocess things +# to detect a host for every test. +Vagrant.plugin("2").manager.registered.dup.each do |plugin| + if plugin.components.hosts.to_hash.length > 0 + Vagrant.plugin("2").manager.unregister(plugin) + end +end diff --git a/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb b/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb index c3f3e6016..4751c083e 100644 --- a/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb +++ b/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb @@ -1,6 +1,7 @@ require_relative "../base" describe VagrantPlugins::ProviderVirtualBox::Action::PrepareNFSSettings do + include_context "unit" include_context "virtualbox" let(:machine) {