diff --git a/plugins/pushes/harmony/config.rb b/plugins/pushes/harmony/config.rb index d9890079e..6698cadec 100644 --- a/plugins/pushes/harmony/config.rb +++ b/plugins/pushes/harmony/config.rb @@ -72,7 +72,7 @@ module VagrantPlugins def validate(machine) errors = _detected_errors - if @app == nil || @app == "" + if @app.to_s.strip.empty? errors << I18n.t("push_harmony.errors.config.app_required") end diff --git a/test/unit/plugins/pushes/harmony/config_test.rb b/test/unit/plugins/pushes/harmony/config_test.rb index 0806156e3..17cd4c1fe 100644 --- a/test/unit/plugins/pushes/harmony/config_test.rb +++ b/test/unit/plugins/pushes/harmony/config_test.rb @@ -50,6 +50,12 @@ describe VagrantPlugins::HarmonyPush::Config do assert_invalid end + it "is invalid if blank" do + subject.app = " " + subject.finalize! + assert_invalid + end + it "is valid if set" do subject.app = "foo/bar" subject.finalize!