From 4a64da5663796f5c2245da6835f6493082d8c039 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 1 Dec 2014 22:20:27 -0800 Subject: [PATCH] Fix some issues around push, fix tests, add missing translations --- plugins/commands/push/command.rb | 2 +- plugins/pushes/atlas/errors.rb | 2 +- plugins/pushes/atlas/locales/en.yml | 6 ++++++ test/unit/plugins/commands/push/command_test.rb | 6 +++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/plugins/commands/push/command.rb b/plugins/commands/push/command.rb index dc02f7ba7..398e4e279 100644 --- a/plugins/commands/push/command.rb +++ b/plugins/commands/push/command.rb @@ -49,7 +49,7 @@ module VagrantPlugins raise Vagrant::Errors::PushStrategyNotProvided, pushes: pushes end else - if !pushes.key?(name.to_sym) + if !pushes.include?(name.to_sym) raise Vagrant::Errors::PushStrategyNotDefined, name: name, pushes: pushes diff --git a/plugins/pushes/atlas/errors.rb b/plugins/pushes/atlas/errors.rb index 6fee42698..7ba1d712a 100644 --- a/plugins/pushes/atlas/errors.rb +++ b/plugins/pushes/atlas/errors.rb @@ -6,7 +6,7 @@ module VagrantPlugins end class UploaderNotFound < Error - error_key(:uploader_error) + error_key(:uploader_not_found) end end end diff --git a/plugins/pushes/atlas/locales/en.yml b/plugins/pushes/atlas/locales/en.yml index 745e33bd2..c54d59e67 100644 --- a/plugins/pushes/atlas/locales/en.yml +++ b/plugins/pushes/atlas/locales/en.yml @@ -9,3 +9,9 @@ en: config.push.define "atlas" do |push| push.%{attribute} = "..." end + uploader_not_found: |- + Vagrant was unable to find the Atlas uploader CLI. If your Vagrantfile + specifies the path explicitly with "uploader_path", then make sure that + path is valid. Otherwise, make sure that you have a valid install of + Vagrant. If you installed Vagrant outside of the official installers, + the "atlas-upload" binary must exist on your PATH. diff --git a/test/unit/plugins/commands/push/command_test.rb b/test/unit/plugins/commands/push/command_test.rb index 85be81766..18998e87a 100644 --- a/test/unit/plugins/commands/push/command_test.rb +++ b/test/unit/plugins/commands/push/command_test.rb @@ -42,7 +42,7 @@ describe VagrantPlugins::CommandPush::Command do describe "#validate_pushes!" do context "when there are no pushes defined" do - let(:pushes) { {} } + let(:pushes) { [] } context "when a strategy is given" do it "raises an exception" do @@ -61,7 +61,7 @@ describe VagrantPlugins::CommandPush::Command do context "when there is one push defined" do let(:noop) { double("noop") } - let(:pushes) { { noop: noop } } + let(:pushes) { [:noop] } context "when a strategy is given" do context "when that strategy is not defined" do @@ -90,7 +90,7 @@ describe VagrantPlugins::CommandPush::Command do context "when there are multiple pushes defined" do let(:noop) { double("noop") } let(:ftp) { double("ftp") } - let(:pushes) { { noop: noop, ftp: ftp } } + let(:pushes) { [:noop, :ftp] } context "when a strategy is given" do context "when that strategy is not defined" do