From d7a9bcda4749994effd50b81b2d497689201f18d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 5 May 2014 21:13:15 -0700 Subject: [PATCH] providers/docker: vagrant_machine setting works proprely --- plugins/providers/docker/config.rb | 3 +++ test/unit/plugins/providers/docker/config_spec.rb | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/plugins/providers/docker/config.rb b/plugins/providers/docker/config.rb index 27b6713cb..96ba3df53 100644 --- a/plugins/providers/docker/config.rb +++ b/plugins/providers/docker/config.rb @@ -139,6 +139,9 @@ module VagrantPlugins @vagrant_machine = nil if @vagrant_machine == UNSET_VALUE @vagrant_vagrantfile = nil if @vagrant_vagrantfile == UNSET_VALUE + # The machine name must be a symbol + @vagrant_machine = @vagrant_machine.to_sym if @vagrant_machine + @expose.uniq! end diff --git a/test/unit/plugins/providers/docker/config_spec.rb b/test/unit/plugins/providers/docker/config_spec.rb index c93bf2c89..60941c326 100644 --- a/test/unit/plugins/providers/docker/config_spec.rb +++ b/test/unit/plugins/providers/docker/config_spec.rb @@ -202,6 +202,17 @@ describe VagrantPlugins::DockerProvider::Config do end end + describe "#vagrant_machine" do + before { valid_defaults } + + it "should convert to a symbol" do + subject.vagrant_machine = "foo" + subject.finalize! + assert_valid + expect(subject.vagrant_machine).to eq(:foo) + end + end + describe "#vagrant_vagrantfile" do before { valid_defaults }