Config JSON doesn't include 'env'

This commit is contained in:
Mitchell Hashimoto 2010-04-11 23:39:22 -07:00
parent 4d3f929b3f
commit 945710e068
2 changed files with 7 additions and 1 deletions

View File

@ -51,7 +51,7 @@ module Vagrant
def instance_variables_hash
instance_variables.inject({}) do |acc, iv|
acc[iv.to_s[1..-1].to_sym] = instance_variable_get(iv)
acc[iv.to_s[1..-1].to_sym] = instance_variable_get(iv) unless iv.to_sym == :@env
acc
end
end

View File

@ -128,6 +128,12 @@ class ConfigTest < Test::Unit::TestCase
@base.expects(:instance_variables_hash).returns(@iv_hash)
assert_equal @json, @base.to_json
end
should "not include env in the JSON hash" do
@base.env = "FOO"
hash = @base.instance_variables_hash
assert !hash.has_key?(:env)
end
end
context "top config class" do