diff --git a/lib/vagrant/config.rb b/lib/vagrant/config.rb index 1219517ea..36942a5b1 100644 --- a/lib/vagrant/config.rb +++ b/lib/vagrant/config.rb @@ -4,21 +4,21 @@ module Vagrant end class Config - @config = nil - @config_runners = [] + @@config = nil + @@config_runners = [] class << self def reset! - @config = nil + @@config = nil config_runners.clear end def config - @config ||= Config::Top.new + @@config ||= Config::Top.new end def config_runners - @config_runners ||= [] + @@config_runners ||= [] end def run(&block) diff --git a/test/test_helper.rb b/test/test_helper.rb index cd0c028be..4c14f3b43 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -20,8 +20,7 @@ require 'mocha' class Test::Unit::TestCase # Clears the previous config and sets up the new config def mock_config - Vagrant::Config.instance_variable_set(:@config_runners, nil) - Vagrant::Config.instance_variable_set(:@config, nil) + Vagrant::Config.reset! Vagrant::Config.run do |config| config.vagrant.dotfile_name = ".hobo" diff --git a/test/vagrant/config_test.rb b/test/vagrant/config_test.rb index f3c635ce8..40110d03e 100644 --- a/test/vagrant/config_test.rb +++ b/test/vagrant/config_test.rb @@ -38,8 +38,7 @@ class ConfigTest < Test::Unit::TestCase context "initializing" do teardown do - Vagrant::Config.instance_variable_set(:@config_runners, nil) - Vagrant::Config.instance_variable_set(:@config, nil) + Vagrant::Config.reset! end should "not run the blocks right away" do