From 945710e068743c5ba2f8643b72dcbe41cb0fd8ed Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 11 Apr 2010 23:39:22 -0700 Subject: [PATCH] Config JSON doesn't include 'env' --- lib/vagrant/config.rb | 2 +- test/vagrant/config_test.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/config.rb b/lib/vagrant/config.rb index 21b106c6a..78e8bccfe 100644 --- a/lib/vagrant/config.rb +++ b/lib/vagrant/config.rb @@ -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 diff --git a/test/vagrant/config_test.rb b/test/vagrant/config_test.rb index 1fadb94d9..82bcffd61 100644 --- a/test/vagrant/config_test.rb +++ b/test/vagrant/config_test.rb @@ -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