mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:25:35 +08:00
FIX: Don't warn on empty .discourse-compatibility (#16032)
This commit is contained in:
parent
586d572e05
commit
cecfc7ce79
|
@ -31,7 +31,7 @@ module Discourse
|
|||
# 2.4.4.beta6: some-other-branch-ref
|
||||
# 2.4.2.beta1: v1-tag
|
||||
def self.find_compatible_resource(version_list, version = ::Discourse::VERSION::STRING)
|
||||
return unless version_list
|
||||
return unless version_list.present?
|
||||
|
||||
begin
|
||||
version_list = YAML.safe_load(version_list)
|
||||
|
|
|
@ -67,6 +67,10 @@ describe Discourse::VERSION do
|
|||
expect(Discourse.find_compatible_resource(nil)).to be_nil
|
||||
end
|
||||
|
||||
it "returns nil when empty" do
|
||||
expect(Discourse.find_compatible_resource("")).to be_nil
|
||||
end
|
||||
|
||||
it "raises an error on invalid input" do
|
||||
expect { Discourse.find_compatible_resource("1.0.0.beta1 12f82d5") }.to raise_error(Discourse::InvalidVersionListError)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user