pushes/harmony: use to_s.strip.empty? to check if app is set

This commit is contained in:
Mitchell Hashimoto 2014-10-29 09:49:37 -07:00 committed by Seth Vargo
parent 1705460880
commit fefaa8da71
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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!