From caae214bf709883cd2255a59239dfe4c7516e315 Mon Sep 17 00:00:00 2001 From: Zhongcheng Lao Date: Mon, 17 Jun 2019 08:21:14 +0800 Subject: [PATCH] Fix provider name not work when specified Provider name should be symbol in guess_provider. --- lib/vagrant/environment.rb | 2 +- test/unit/vagrant/environment_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index f0b8114ff..5cd2dbedd 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -938,7 +938,7 @@ module Vagrant break end end - return gp if gp + return gp.to_sym if gp begin default_provider rescue Errors::NoDefaultProvider diff --git a/test/unit/vagrant/environment_test.rb b/test/unit/vagrant/environment_test.rb index 8be6ddeed..ec517aafa 100644 --- a/test/unit/vagrant/environment_test.rb +++ b/test/unit/vagrant/environment_test.rb @@ -1447,7 +1447,7 @@ VF let(:argv) { ["--provider=single_arg"] } it "should return the provider name" do - expect(subject.send(:guess_provider)).to eq("single_arg") + expect(subject.send(:guess_provider)).to eq(:single_arg) end end @@ -1455,7 +1455,7 @@ VF let(:argv) { ["--provider", "double_arg"] } it "should return the provider name" do - expect(subject.send(:guess_provider)).to eq("double_arg") + expect(subject.send(:guess_provider)).to eq(:double_arg) end end end