diff --git a/plugins/guests/debian/cap/change_host_name.rb b/plugins/guests/debian/cap/change_host_name.rb index b64c236f8..21b95fec5 100644 --- a/plugins/guests/debian/cap/change_host_name.rb +++ b/plugins/guests/debian/cap/change_host_name.rb @@ -83,10 +83,10 @@ module VagrantPlugins interfaces = VagrantPlugins::GuestLinux::Cap::NetworkInterfaces.network_interfaces(machine) nettools = true if systemd?(comm) - @logger.debug("Attempting to restart networking with systemctl") + logger.debug("Attempting to restart networking with systemctl") nettools = false else - @logger.debug("Attempting to restart networking with ifup/down nettools") + logger.debug("Attempting to restart networking with ifup/down nettools") end interfaces.each do |iface| diff --git a/test/unit/plugins/providers/virtualbox/synced_folder_test.rb b/test/unit/plugins/providers/virtualbox/synced_folder_test.rb index ea8682586..9ea631ea9 100644 --- a/test/unit/plugins/providers/virtualbox/synced_folder_test.rb +++ b/test/unit/plugins/providers/virtualbox/synced_folder_test.rb @@ -205,6 +205,7 @@ describe VagrantPlugins::ProviderVirtualBox::SyncedFolder do allow(machine).to receive(:env) allow(subject).to receive(:driver).and_return(driver) allow(driver).to receive(:share_folders) + allow(ENV).to receive(:[]).and_call_original allow(ENV).to receive(:[]).with("VAGRANT_DISABLE_VBOXSYMLINKCREATE").and_return(symlink_create_disable) end diff --git a/test/unit/vagrant/util/experimental_test.rb b/test/unit/vagrant/util/experimental_test.rb index d4a03c4ad..9c21a2927 100644 --- a/test/unit/vagrant/util/experimental_test.rb +++ b/test/unit/vagrant/util/experimental_test.rb @@ -4,7 +4,8 @@ require "vagrant/util/experimental" describe Vagrant::Util::Experimental do include_context "unit" - before(:each) { described_class.reset! } + before(:all) { described_class.reset! } + after(:each) { described_class.reset! } subject { described_class } describe "#enabled?" do diff --git a/test/unit/vagrant/util/platform_test.rb b/test/unit/vagrant/util/platform_test.rb index 9e0506614..e0dc29c84 100644 --- a/test/unit/vagrant/util/platform_test.rb +++ b/test/unit/vagrant/util/platform_test.rb @@ -4,7 +4,8 @@ require "vagrant/util/platform" describe Vagrant::Util::Platform do include_context "unit" - after{ described_class.reset! } + before(:all) { described_class.reset! } + after { described_class.reset! } subject { described_class } describe "#cygwin_path" do diff --git a/test/unit/vagrant_test.rb b/test/unit/vagrant_test.rb index e5b9ca00b..4f79750a9 100644 --- a/test/unit/vagrant_test.rb +++ b/test/unit/vagrant_test.rb @@ -48,11 +48,6 @@ describe Vagrant do end describe "has_plugin?" do - after(:each) do - manager.reset! - end - - let(:manager) { described_class.plugin("2").manager } it "should find the installed plugin by the registered name" do Class.new(described_class.plugin(Vagrant::Config::CURRENT_VERSION)) do