Skip to content
Snippets Groups Projects
Commit ce454bd1 authored by Alyssa Ross's avatar Alyssa Ross
Browse files

tab: parse full Homebrew version string

It didn't occur to me that this would work, but it does! Magic.
parent e5db7927
No related branches found
No related tags found
No related merge requests found
......@@ -248,7 +248,7 @@ class Tab < OpenStruct
def parsed_homebrew_version
return Version::NULL if homebrew_version.nil?
Version.new(homebrew_tag)
Version.new(homebrew_version)
end
# Whether there is reliable runtime dependency information in the receipt.
......
......@@ -86,11 +86,18 @@ class TabTests < Homebrew::TestCase
tab = Tab.new(homebrew_version: "1.2.3")
assert_equal "1.2.3", tab.parsed_homebrew_version
assert tab.parsed_homebrew_version < "1.2.3-1-g12789abdf"
assert_kind_of Version, tab.parsed_homebrew_version
tab.homebrew_version = "1.2.4-567-g12789abdf"
assert tab.parsed_homebrew_version > "1.2.4"
assert tab.parsed_homebrew_version > "1.2.4-566-g21789abdf"
assert tab.parsed_homebrew_version < "1.2.4-568-g01789abdf"
tab = Tab.new(homebrew_version: "2.0.0-134-gabcdefabc-dirty")
assert_equal "2.0.0", tab.parsed_homebrew_version
assert_kind_of Version, tab.parsed_homebrew_version
assert tab.parsed_homebrew_version > "2.0.0"
assert tab.parsed_homebrew_version > "2.0.0-133-g21789abdf"
assert tab.parsed_homebrew_version < "2.0.0-135-g01789abdf"
end
def test_reliable_runtime_dependencies?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment