From 51353d51fc0238075a6be28fc3af7a8711f4504e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 11 Jan 2012 21:31:19 -0800 Subject: [PATCH] Test base merge --- test/unit/vagrant/config/base_test.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/unit/vagrant/config/base_test.rb diff --git a/test/unit/vagrant/config/base_test.rb b/test/unit/vagrant/config/base_test.rb new file mode 100644 index 000000000..918c3a0cf --- /dev/null +++ b/test/unit/vagrant/config/base_test.rb @@ -0,0 +1,25 @@ +require File.expand_path("../../../base", __FILE__) + +describe Vagrant::Config::Base do + include_context "unit" + + let(:foo_class) do + Class.new(described_class) do + attr_accessor :one + attr_accessor :two + end + end + + it "should merge by default by simply copying each instance variable" do + one = foo_class.new + one.one = 2 + one.two = 1 + + two = foo_class.new + two.two = 5 + + result = one.merge(two) + result.one.should == 2 + result.two.should == 5 + end +end