mixlib-versioning 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +22 -0
- data/.travis.yml +24 -0
- data/CHANGELOG.md +16 -1
- data/Gemfile +3 -4
- data/README.md +9 -15
- data/Rakefile +15 -3
- data/lib/mixlib/versioning.rb +32 -29
- data/lib/mixlib/versioning/exceptions.rb +1 -1
- data/lib/mixlib/versioning/format.rb +33 -31
- data/lib/mixlib/versioning/format/git_describe.rb +5 -7
- data/lib/mixlib/versioning/format/opscode_semver.rb +6 -17
- data/lib/mixlib/versioning/format/rubygems.rb +6 -8
- data/lib/mixlib/versioning/format/semver.rb +9 -11
- data/lib/mixlib/versioning/version.rb +2 -2
- data/mixlib-versioning.gemspec +20 -14
- data/spec/mixlib/versioning/format/git_describe_spec.rb +143 -131
- data/spec/mixlib/versioning/format/opscode_semver_spec.rb +106 -81
- data/spec/mixlib/versioning/format/rubygems_spec.rb +119 -104
- data/spec/mixlib/versioning/format/semver_spec.rb +98 -77
- data/spec/mixlib/versioning/format_spec.rb +17 -25
- data/spec/mixlib/versioning/versioning_spec.rb +163 -141
- data/spec/spec_helper.rb +2 -2
- data/spec/support/shared_examples/basic_semver.rb +19 -21
- data/spec/support/shared_examples/behaviors/comparable.rb +80 -0
- data/spec/support/shared_examples/behaviors/filterable.rb +19 -31
- data/spec/support/shared_examples/behaviors/parses_valid_version_strings.rb +4 -7
- data/spec/support/shared_examples/behaviors/rejects_invalid_version_strings.rb +3 -6
- data/spec/support/shared_examples/behaviors/serializable.rb +5 -7
- data/spec/support/shared_examples/behaviors/sortable.rb +7 -9
- data/spec/support/shared_examples/semver.rb +81 -69
- metadata +51 -26
- data/.yardopts +0 -7
- data/CONTRIBUTING.md +0 -188
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Seth Chisamore (<schisamo@
|
3
|
-
# Author:: Christopher Maier (<cm@
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
|
+
# Author:: Christopher Maier (<cm@chef.io>)
|
4
4
|
# Copyright:: Copyright (c) 2013 Opscode, Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
@@ -41,10 +41,9 @@ module Mixlib
|
|
41
41
|
# 11.0.0-alpha.1-1-gcea071e
|
42
42
|
# ```
|
43
43
|
#
|
44
|
-
# @author Seth Chisamore (<schisamo@
|
45
|
-
# @author Christopher Maier (<cm@
|
44
|
+
# @author Seth Chisamore (<schisamo@chef.io>)
|
45
|
+
# @author Christopher Maier (<cm@chef.io>)
|
46
46
|
class GitDescribe < Format
|
47
|
-
|
48
47
|
GIT_DESCRIBE_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:\-|\.)?(.+)?\-(\d+)\-g([a-f0-9]{7,40})(?:\-)?(\d+)?$/
|
49
48
|
|
50
49
|
attr_reader :commits_since, :commit_sha
|
@@ -54,7 +53,7 @@ module Mixlib
|
|
54
53
|
match = version_string.match(GIT_DESCRIBE_REGEX) rescue nil
|
55
54
|
|
56
55
|
unless match
|
57
|
-
|
56
|
+
fail Mixlib::Versioning::ParseError, "'#{version_string}' is not a valid #{self.class} version string!"
|
58
57
|
end
|
59
58
|
|
60
59
|
@major, @minor, @patch, @prerelease, @commits_since, @commit_sha, @iteration = match[1..7]
|
@@ -64,7 +63,6 @@ module Mixlib
|
|
64
63
|
# we'll store our internal information in that format
|
65
64
|
@build = "#{@commits_since}.g#{@commit_sha}.#{@iteration}"
|
66
65
|
end
|
67
|
-
|
68
66
|
end # class GitDescribe
|
69
67
|
end # class Format
|
70
68
|
end # module Versioning
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Seth Chisamore (<schisamo@
|
3
|
-
# Author:: Christopher Maier (<cm@
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
|
+
# Author:: Christopher Maier (<cm@chef.io>)
|
4
4
|
# Copyright:: Copyright (c) 2013 Opscode, Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
@@ -51,10 +51,9 @@ module Mixlib
|
|
51
51
|
# 11.0.0-alpha1+20121218164140.git.207.694b062
|
52
52
|
# ```
|
53
53
|
#
|
54
|
-
# @author Seth Chisamore (<schisamo@
|
55
|
-
# @author Christopher Maier (<cm@
|
54
|
+
# @author Seth Chisamore (<schisamo@chef.io>)
|
55
|
+
# @author Christopher Maier (<cm@chef.io>)
|
56
56
|
class OpscodeSemVer < SemVer
|
57
|
-
|
58
57
|
# The pattern is: `YYYYMMDDHHMMSS.git.COMMITS_SINCE.SHA1`
|
59
58
|
OPSCODE_BUILD_REGEX = /^\d{14}(\.git\.\d+\.[a-f0-9]{7})?$/
|
60
59
|
|
@@ -72,19 +71,9 @@ module Mixlib
|
|
72
71
|
def parse(version_string)
|
73
72
|
super(version_string)
|
74
73
|
|
75
|
-
unless @prerelease.nil?
|
76
|
-
|
77
|
-
raise Mixlib::Versioning::ParseError, "'#{@prerelease}' is not a valid Opscode pre-release signifier!"
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
unless @build.nil?
|
82
|
-
unless @build.match(OPSCODE_BUILD_REGEX)
|
83
|
-
raise Mixlib::Versioning::ParseError, "'#{@build}' is not a valid Opscode build signifier!"
|
84
|
-
end
|
85
|
-
end
|
74
|
+
fail Mixlib::Versioning::ParseError, "'#{@prerelease}' is not a valid Opscode pre-release signifier!" unless @prerelease.nil? || @prerelease.match(OPSCODE_PRERELEASE_REGEX)
|
75
|
+
fail Mixlib::Versioning::ParseError, "'#{@build}' is not a valid Opscode build signifier!" unless @build.nil? || @build.match(OPSCODE_BUILD_REGEX)
|
86
76
|
end
|
87
|
-
|
88
77
|
end # class OpscodeSemVer
|
89
78
|
end # class Format
|
90
79
|
end # module Versioning
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Seth Chisamore (<schisamo@
|
3
|
-
# Author:: Christopher Maier (<cm@
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
|
+
# Author:: Christopher Maier (<cm@chef.io>)
|
4
4
|
# Copyright:: Copyright (c) 2013 Opscode, Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
@@ -39,10 +39,9 @@ module Mixlib
|
|
39
39
|
# 10.16.2
|
40
40
|
# ```
|
41
41
|
#
|
42
|
-
# @author Seth Chisamore (<schisamo@
|
43
|
-
# @author Christopher Maier (<cm@
|
42
|
+
# @author Seth Chisamore (<schisamo@chef.io>)
|
43
|
+
# @author Christopher Maier (<cm@chef.io>)
|
44
44
|
class Rubygems < Format
|
45
|
-
|
46
45
|
RUBYGEMS_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:\.([[:alnum:]]+(?:\.[[:alnum:]]+)?))?(?:\-(\d+))?$/
|
47
46
|
|
48
47
|
# @see Format#parse
|
@@ -50,16 +49,15 @@ module Mixlib
|
|
50
49
|
match = version_string.match(RUBYGEMS_REGEX) rescue nil
|
51
50
|
|
52
51
|
unless match
|
53
|
-
|
52
|
+
fail Mixlib::Versioning::ParseError, "'#{version_string}' is not a valid #{self.class} version string!"
|
54
53
|
end
|
55
54
|
|
56
55
|
@major, @minor, @patch, @prerelease, @iteration = match[1..5]
|
57
56
|
@major, @minor, @patch, @iteration = [@major, @minor, @patch, @iteration].map(&:to_i)
|
58
57
|
|
59
58
|
# Do not convert @build to an integer; SemVer sorting logic will handle the conversion
|
60
|
-
@prerelease = nil if
|
59
|
+
@prerelease = nil if @prerelease.nil? || @prerelease.empty?
|
61
60
|
end
|
62
|
-
|
63
61
|
end # class Rubygems
|
64
62
|
end # class Format
|
65
63
|
end # module Versioning
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Seth Chisamore (<schisamo@
|
3
|
-
# Author:: Christopher Maier (<cm@
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
|
+
# Author:: Christopher Maier (<cm@chef.io>)
|
4
4
|
# Copyright:: Copyright (c) 2013 Opscode, Inc.
|
5
5
|
# License:: Apache License, Version 2.0
|
6
6
|
#
|
@@ -28,7 +28,7 @@ module Mixlib
|
|
28
28
|
# MAJOR.MINOR.PATCH
|
29
29
|
# MAJOR.MINOR.PATCH-PRERELEASE
|
30
30
|
# MAJOR.MINOR.PATCH-PRERELEASE+BUILD
|
31
|
-
|
31
|
+
# ```
|
32
32
|
#
|
33
33
|
# EXAMPLES
|
34
34
|
# --------
|
@@ -39,27 +39,25 @@ module Mixlib
|
|
39
39
|
# 11.0.0-alpha1+20121218164140.git.207.694b062
|
40
40
|
# ```
|
41
41
|
#
|
42
|
-
# @author Seth Chisamore (<schisamo@
|
43
|
-
# @author Christopher Maier (<cm@
|
42
|
+
# @author Seth Chisamore (<schisamo@chef.io>)
|
43
|
+
# @author Christopher Maier (<cm@chef.io>)
|
44
44
|
class SemVer < Format
|
45
|
-
|
46
|
-
SEMVER_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:\-([\dA-Za-z\-\.]+))?(?:\+([\dA-Za-z\-\.]+))?$/
|
45
|
+
SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][a-zA-Z0-9-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][a-zA-Z0-9-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/
|
47
46
|
|
48
47
|
# @see Format#parse
|
49
48
|
def parse(version_string)
|
50
49
|
match = version_string.match(SEMVER_REGEX) rescue nil
|
51
50
|
|
52
51
|
unless match
|
53
|
-
|
52
|
+
fail Mixlib::Versioning::ParseError, "'#{version_string}' is not a valid #{self.class} version string!"
|
54
53
|
end
|
55
54
|
|
56
55
|
@major, @minor, @patch, @prerelease, @build = match[1..5]
|
57
56
|
@major, @minor, @patch = [@major, @minor, @patch].map(&:to_i)
|
58
57
|
|
59
|
-
@prerelease = nil if
|
60
|
-
@build = nil if
|
58
|
+
@prerelease = nil if @prerelease.nil? || @prerelease.empty?
|
59
|
+
@build = nil if @build.nil? || @build.empty?
|
61
60
|
end
|
62
|
-
|
63
61
|
end # class SemVer
|
64
62
|
end # class Format
|
65
63
|
end # module Versioning
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Seth Chisamore (<schisamo@
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
3
|
# Copyright:: Copyright (c) 2013 Opscode, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
@@ -18,6 +18,6 @@
|
|
18
18
|
|
19
19
|
module Mixlib
|
20
20
|
class Versioning
|
21
|
-
VERSION =
|
21
|
+
VERSION = '1.1.0'
|
22
22
|
end
|
23
23
|
end
|
data/mixlib-versioning.gemspec
CHANGED
@@ -3,20 +3,26 @@ lib = File.expand_path('../lib', __FILE__)
|
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'mixlib/versioning/version'
|
5
5
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'mixlib-versioning'
|
8
|
+
spec.version = Mixlib::Versioning::VERSION
|
9
|
+
spec.authors = ['Seth Chisamore', 'Christopher Maier']
|
10
|
+
spec.email = ['schisamo@chef.io', 'cm@chef.io']
|
11
|
+
spec.description = 'General purpose Ruby library that allows you to parse, compare and manipulate version strings in multiple formats.'
|
12
|
+
spec.summary = spec.description
|
13
|
+
spec.homepage = 'https://github.com/chef/mixlib-versioning'
|
14
|
+
spec.license = 'Apache 2.0'
|
14
15
|
|
15
|
-
|
16
|
-
gem.add_development_dependency "rspec_junit_formatter"
|
16
|
+
spec.required_ruby_version = '>= 1.9'
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
20
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
|
+
spec.require_paths = ['lib']
|
22
|
+
|
23
|
+
# Development dependencies
|
24
|
+
spec.add_development_dependency 'rubocop', '= 0.31.0'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 2.14'
|
26
|
+
spec.add_development_dependency 'bundler'
|
27
|
+
spec.add_development_dependency 'rake'
|
22
28
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Author:: Seth Chisamore (<schisamo@
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
3
|
# Copyright:: Copyright (c) 2013 Opscode, Inc.
|
4
4
|
# License:: Apache License, Version 2.0
|
5
5
|
#
|
@@ -19,101 +19,100 @@
|
|
19
19
|
require 'spec_helper'
|
20
20
|
|
21
21
|
describe Mixlib::Versioning::Format::GitDescribe do
|
22
|
+
subject { described_class.new(version_string) }
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
|
39
|
-
|
24
|
+
it_has_behavior 'parses valid version strings', {
|
25
|
+
'0.10.8-231-g59d6185' => {
|
26
|
+
major: 0,
|
27
|
+
minor: 10,
|
28
|
+
patch: 8,
|
29
|
+
prerelease: nil,
|
30
|
+
build: '231.g59d6185.0',
|
31
|
+
release?: false,
|
32
|
+
prerelease?: false,
|
33
|
+
build?: true,
|
34
|
+
release_build?: true,
|
35
|
+
prerelease_build?: false,
|
36
|
+
commits_since: 231,
|
37
|
+
commit_sha: '59d6185',
|
38
|
+
iteration: 0,
|
39
|
+
},
|
40
|
+
'10.16.2-49-g21353f0-1' => {
|
41
|
+
major: 10,
|
42
|
+
minor: 16,
|
43
|
+
patch: 2,
|
44
|
+
prerelease: nil,
|
45
|
+
build: '49.g21353f0.1',
|
46
|
+
release?: false,
|
47
|
+
prerelease?: false,
|
48
|
+
build?: true,
|
49
|
+
release_build?: true,
|
50
|
+
prerelease_build?: false,
|
51
|
+
commits_since: 49,
|
52
|
+
commit_sha: '21353f0',
|
53
|
+
iteration: 1,
|
40
54
|
},
|
41
|
-
|
42
|
-
:
|
43
|
-
:
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
:
|
53
|
-
:
|
54
|
-
:
|
55
|
+
'10.16.2.rc.1-49-g21353f0-1' => {
|
56
|
+
major: 10,
|
57
|
+
minor: 16,
|
58
|
+
patch: 2,
|
59
|
+
prerelease: 'rc.1',
|
60
|
+
build: '49.g21353f0.1',
|
61
|
+
release?: false,
|
62
|
+
prerelease?: false,
|
63
|
+
build?: true,
|
64
|
+
release_build?: false,
|
65
|
+
prerelease_build?: true,
|
66
|
+
commits_since: 49,
|
67
|
+
commit_sha: '21353f0',
|
68
|
+
iteration: 1,
|
55
69
|
},
|
56
|
-
|
57
|
-
:
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
:
|
68
|
-
:
|
69
|
-
:
|
70
|
+
'10.16.2-alpha-49-g21353f0-1' => {
|
71
|
+
major: 10,
|
72
|
+
minor: 16,
|
73
|
+
patch: 2,
|
74
|
+
prerelease: 'alpha',
|
75
|
+
build: '49.g21353f0.1',
|
76
|
+
release?: false,
|
77
|
+
prerelease?: false,
|
78
|
+
build?: true,
|
79
|
+
release_build?: false,
|
80
|
+
prerelease_build?: true,
|
81
|
+
commits_since: 49,
|
82
|
+
commit_sha: '21353f0',
|
83
|
+
iteration: 1,
|
70
84
|
},
|
71
|
-
|
72
|
-
:
|
73
|
-
:
|
74
|
-
:
|
75
|
-
:
|
76
|
-
:
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
:
|
83
|
-
:
|
84
|
-
:
|
85
|
+
'10.16.2-alpha-49-g21353f0' => {
|
86
|
+
major: 10,
|
87
|
+
minor: 16,
|
88
|
+
patch: 2,
|
89
|
+
prerelease: 'alpha',
|
90
|
+
build: '49.g21353f0.0',
|
91
|
+
release?: false,
|
92
|
+
prerelease?: false,
|
93
|
+
build?: true,
|
94
|
+
release_build?: false,
|
95
|
+
prerelease_build?: true,
|
96
|
+
commits_since: 49,
|
97
|
+
commit_sha: '21353f0',
|
98
|
+
iteration: 0,
|
85
99
|
},
|
86
|
-
"10.16.2-alpha-49-g21353f0" => {
|
87
|
-
:major => 10,
|
88
|
-
:minor => 16,
|
89
|
-
:patch => 2,
|
90
|
-
:prerelease => "alpha",
|
91
|
-
:build => "49.g21353f0.0",
|
92
|
-
:release? => false,
|
93
|
-
:prerelease? => false,
|
94
|
-
:build? => true,
|
95
|
-
:release_build? => false,
|
96
|
-
:prerelease_build? => true,
|
97
|
-
:commits_since => 49,
|
98
|
-
:commit_sha => "21353f0",
|
99
|
-
:iteration => 0
|
100
|
-
}
|
101
100
|
}
|
102
101
|
|
103
|
-
it_has_behavior
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
102
|
+
it_has_behavior 'rejects invalid version strings', {
|
103
|
+
'1.0.0' => 'no git describe data',
|
104
|
+
'1.0.0-alpha.1' => 'no git describe data',
|
105
|
+
'1.0.0-alpha.1+build.deadbeef' => 'no git describe data',
|
106
|
+
'1.0.0-123-gfd0e3a65282cb5f6df3bab6a53f4fcb722340d499-1' => 'too many SHA1 characters',
|
107
|
+
'1.0.0-123-gdeadbe-1' => 'too few SHA1 characters',
|
108
|
+
'1.0.0-123-gNOTHEX1-1' => 'illegal SHA1 characters',
|
109
|
+
'1.0.0-123-g1234567-alpha' => 'non-numeric iteration',
|
110
|
+
'1.0.0-alpha-poop-g1234567-1' => "non-numeric 'commits_since'",
|
111
|
+
'1.0.0-g1234567-1' => "missing 'commits_since'",
|
112
|
+
'1.0.0-123-1' => 'missing SHA1',
|
114
113
|
}
|
115
114
|
|
116
|
-
version_strings = %w
|
115
|
+
version_strings = %w(
|
117
116
|
9.0.1-1-gdeadbee-1
|
118
117
|
9.1.2-2-g1234567-1
|
119
118
|
10.0.0-1-gabcdef3-1
|
@@ -124,55 +123,68 @@ describe Mixlib::Versioning::Format::GitDescribe do
|
|
124
123
|
9.0.1-2-gdeadbe1-2
|
125
124
|
9.0.1-2-gdeadbe2-1
|
126
125
|
9.1.1-2-g1234567-1
|
127
|
-
|
126
|
+
)
|
128
127
|
|
129
|
-
it_has_behavior
|
128
|
+
it_has_behavior 'serializable', version_strings
|
130
129
|
|
131
|
-
it_has_behavior
|
132
|
-
let(:unsorted_version_strings){ version_strings }
|
133
|
-
let(:sorted_version_strings)
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
130
|
+
it_has_behavior 'sortable' do
|
131
|
+
let(:unsorted_version_strings) { version_strings }
|
132
|
+
let(:sorted_version_strings) do
|
133
|
+
%w(
|
134
|
+
9.0.1-1-gdeadbee-1
|
135
|
+
9.0.1-2-gdeadbe1-1
|
136
|
+
9.0.1-2-gdeadbe1-2
|
137
|
+
9.0.1-2-gdeadbe2-1
|
138
|
+
9.1.1-2-g1234567-1
|
139
|
+
9.1.2-2-g1234567-1
|
140
|
+
10.0.0-1-gabcdef3-1
|
141
|
+
10.5.7-2-g21353f0-1
|
142
|
+
10.20.2-2-gbbbbbbb-1
|
143
|
+
10.20.2-3-gaaaaaaa-1
|
144
|
+
)
|
145
|
+
end
|
146
|
+
let(:min) { '9.0.1-1-gdeadbee-1' }
|
147
|
+
let(:max) { '10.20.2-3-gaaaaaaa-1' }
|
147
148
|
end # it_has_behavior
|
148
149
|
|
149
150
|
# The +GitDescribe+ format only produces release build versions.
|
150
|
-
it_has_behavior
|
151
|
-
let(:unsorted_version_strings){ version_strings }
|
152
|
-
let(:build_versions)
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
151
|
+
it_has_behavior 'filterable' do
|
152
|
+
let(:unsorted_version_strings) { version_strings }
|
153
|
+
let(:build_versions) do
|
154
|
+
%w(
|
155
|
+
9.0.1-1-gdeadbee-1
|
156
|
+
9.1.2-2-g1234567-1
|
157
|
+
10.0.0-1-gabcdef3-1
|
158
|
+
10.5.7-2-g21353f0-1
|
159
|
+
10.20.2-2-gbbbbbbb-1
|
160
|
+
10.20.2-3-gaaaaaaa-1
|
161
|
+
9.0.1-2-gdeadbe1-1
|
162
|
+
9.0.1-2-gdeadbe1-2
|
163
|
+
9.0.1-2-gdeadbe2-1
|
164
|
+
9.1.1-2-g1234567-1
|
165
|
+
)
|
166
|
+
end
|
167
|
+
let(:release_build_versions) do
|
168
|
+
%w(
|
169
|
+
9.0.1-1-gdeadbee-1
|
170
|
+
9.1.2-2-g1234567-1
|
171
|
+
10.0.0-1-gabcdef3-1
|
172
|
+
10.5.7-2-g21353f0-1
|
173
|
+
10.20.2-2-gbbbbbbb-1
|
174
|
+
10.20.2-3-gaaaaaaa-1
|
175
|
+
9.0.1-2-gdeadbe1-1
|
176
|
+
9.0.1-2-gdeadbe1-2
|
177
|
+
9.0.1-2-gdeadbe2-1
|
178
|
+
9.1.1-2-g1234567-1
|
179
|
+
)
|
180
|
+
end
|
176
181
|
end # it_has_behavior
|
177
182
|
|
183
|
+
it_has_behavior 'comparable', [
|
184
|
+
'9.0.1-1-gdeadbee-1', '9.0.1-2-gdeadbe1-1',
|
185
|
+
'9.0.1-2-gdeadbe1-2', '9.0.1-2-gdeadbe2-1',
|
186
|
+
'9.1.1-2-g1234567-1', '9.1.2-2-g1234567-1',
|
187
|
+
'10.0.0-1-gabcdef3-1', '10.5.7-2-g21353f0-1',
|
188
|
+
'10.20.2-2-gbbbbbbb-1', '10.20.2-3-gaaaaaaa-1'
|
189
|
+
]
|
178
190
|
end # describe
|