pushes/harmony: use to_s.strip.empty? to check if app is set
This commit is contained in:
parent
1705460880
commit
fefaa8da71
|
@ -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
|
||||
|
||||
|
|
|
@ -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!
|
||||
|
|
Loading…
Reference in New Issue