From 1d1dfec94038117ff7ba1ed78a8483dcd96e84bf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 8 Feb 2013 16:55:06 -0800 Subject: [PATCH] Additional unit test to verify missing config key behavior --- test/unit/vagrant/config/v2/root_test.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/unit/vagrant/config/v2/root_test.rb b/test/unit/vagrant/config/v2/root_test.rb index 50a6c775a..c5c72874e 100644 --- a/test/unit/vagrant/config/v2/root_test.rb +++ b/test/unit/vagrant/config/v2/root_test.rb @@ -21,6 +21,11 @@ describe Vagrant::Config::V2::Root do instance.__internal_state["missing_key_calls"].include?("foo").should be end + it "returns an OpenStruct for a missing key" do + instance = described_class.new({}) + expect { instance.foo.foo = "bar" }.to_not raise_error + end + it "can be created with initial state" do instance = described_class.new({}, { :foo => "bar" }) instance.foo.should == "bar"