Config class now properly uses class variables. Not sure how this one slipped through the cracks.
This commit is contained in:
parent
631580fc8e
commit
3daf48b70c
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue