Merge pull request #4346 from commitay/version-minor_patch
cask dsl versions: add minor_patch
This commit is contained in:
commit
9831e67452
@ -84,6 +84,10 @@ module Hbc
|
|||||||
version { [major, minor, patch].reject(&:empty?).join(".") }
|
version { [major, minor, patch].reject(&:empty?).join(".") }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def minor_patch
|
||||||
|
version { [minor, patch].reject(&:empty?).join(".") }
|
||||||
|
end
|
||||||
|
|
||||||
def before_comma
|
def before_comma
|
||||||
version { split(",", 2)[0] }
|
version { split(",", 2)[0] }
|
||||||
end
|
end
|
||||||
|
|||||||
@ -121,6 +121,14 @@ describe Hbc::DSL::Version, :cask do
|
|||||||
"1.2.3_4-5" => "1.2.3"
|
"1.2.3_4-5" => "1.2.3"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#minor_patch" do
|
||||||
|
include_examples "version expectations hash", :minor_patch,
|
||||||
|
"1" => "",
|
||||||
|
"1.2" => "2",
|
||||||
|
"1.2.3" => "2.3",
|
||||||
|
"1.2.3_4-5" => "2.3"
|
||||||
|
end
|
||||||
|
|
||||||
describe "#before_comma" do
|
describe "#before_comma" do
|
||||||
include_examples "version expectations hash", :before_comma,
|
include_examples "version expectations hash", :before_comma,
|
||||||
"1.2.3" => "1.2.3",
|
"1.2.3" => "1.2.3",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user