mixlib-versioning 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +22 -0
  4. data/.travis.yml +24 -0
  5. data/CHANGELOG.md +16 -1
  6. data/Gemfile +3 -4
  7. data/README.md +9 -15
  8. data/Rakefile +15 -3
  9. data/lib/mixlib/versioning.rb +32 -29
  10. data/lib/mixlib/versioning/exceptions.rb +1 -1
  11. data/lib/mixlib/versioning/format.rb +33 -31
  12. data/lib/mixlib/versioning/format/git_describe.rb +5 -7
  13. data/lib/mixlib/versioning/format/opscode_semver.rb +6 -17
  14. data/lib/mixlib/versioning/format/rubygems.rb +6 -8
  15. data/lib/mixlib/versioning/format/semver.rb +9 -11
  16. data/lib/mixlib/versioning/version.rb +2 -2
  17. data/mixlib-versioning.gemspec +20 -14
  18. data/spec/mixlib/versioning/format/git_describe_spec.rb +143 -131
  19. data/spec/mixlib/versioning/format/opscode_semver_spec.rb +106 -81
  20. data/spec/mixlib/versioning/format/rubygems_spec.rb +119 -104
  21. data/spec/mixlib/versioning/format/semver_spec.rb +98 -77
  22. data/spec/mixlib/versioning/format_spec.rb +17 -25
  23. data/spec/mixlib/versioning/versioning_spec.rb +163 -141
  24. data/spec/spec_helper.rb +2 -2
  25. data/spec/support/shared_examples/basic_semver.rb +19 -21
  26. data/spec/support/shared_examples/behaviors/comparable.rb +80 -0
  27. data/spec/support/shared_examples/behaviors/filterable.rb +19 -31
  28. data/spec/support/shared_examples/behaviors/parses_valid_version_strings.rb +4 -7
  29. data/spec/support/shared_examples/behaviors/rejects_invalid_version_strings.rb +3 -6
  30. data/spec/support/shared_examples/behaviors/serializable.rb +5 -7
  31. data/spec/support/shared_examples/behaviors/sortable.rb +7 -9
  32. data/spec/support/shared_examples/semver.rb +81 -69
  33. metadata +51 -26
  34. data/.yardopts +0 -7
  35. data/CONTRIBUTING.md +0 -188
@@ -1,6 +1,6 @@
1
1
  #
2
- # Author:: Seth Chisamore (<schisamo@opscode.com>)
3
- # Author:: Christopher Maier (<cm@opscode.com>)
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@opscode.com>)
45
- # @author Christopher Maier (<cm@opscode.com>)
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
- raise Mixlib::Versioning::ParseError, "'#{version_string}' is not a valid #{self.class} version string!"
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@opscode.com>)
3
- # Author:: Christopher Maier (<cm@opscode.com>)
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@opscode.com>)
55
- # @author Christopher Maier (<cm@opscode.com>)
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
- unless @prerelease.match(OPSCODE_PRERELEASE_REGEX)
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@opscode.com>)
3
- # Author:: Christopher Maier (<cm@opscode.com>)
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@opscode.com>)
43
- # @author Christopher Maier (<cm@opscode.com>)
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
- raise Mixlib::Versioning::ParseError, "'#{version_string}' is not a valid #{self.class} version string!"
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 (@prerelease.nil? || @prerelease.empty?)
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@opscode.com>)
3
- # Author:: Christopher Maier (<cm@opscode.com>)
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@opscode.com>)
43
- # @author Christopher Maier (<cm@opscode.com>)
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
- raise Mixlib::Versioning::ParseError, "'#{version_string}' is not a valid #{self.class} version string!"
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 (@prerelease.nil? || @prerelease.empty?)
60
- @build = nil if (@build.nil? || @build.empty?)
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@opscode.com>)
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 = "1.0.0"
21
+ VERSION = '1.1.0'
22
22
  end
23
23
  end
@@ -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 |gem|
7
- gem.name = "mixlib-versioning"
8
- gem.version = Mixlib::Versioning::VERSION
9
- gem.authors = ["Seth Chisamore", "Christopher Maier"]
10
- gem.email = ["schisamo@opscode.com", "cm@opscode.com"]
11
- gem.description = "General purpose Ruby library that allows you to parse, compare and manipulate version strings in multiple formats."
12
- gem.summary = gem.description
13
- gem.homepage = "https://github.com/opscode/mixlib-versioning"
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
- gem.add_development_dependency "rspec"
16
- gem.add_development_dependency "rspec_junit_formatter"
16
+ spec.required_ruby_version = '>= 1.9'
17
17
 
18
- gem.files = `git ls-files`.split($/)
19
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
21
- gem.require_paths = ["lib"]
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@opscode.com>)
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
- subject{ described_class.new(version_string) }
24
-
25
- it_has_behavior "parses valid version strings", {
26
- "0.10.8-231-g59d6185" => {
27
- :major => 0,
28
- :minor => 10,
29
- :patch => 8,
30
- :prerelease => nil,
31
- :build => "231.g59d6185.0",
32
- :release? => false,
33
- :prerelease? => false,
34
- :build? => true,
35
- :release_build? => true,
36
- :prerelease_build? => false,
37
- :commits_since => 231,
38
- :commit_sha => "59d6185",
39
- :iteration => 0
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
- "10.16.2-49-g21353f0-1" => {
42
- :major => 10,
43
- :minor => 16,
44
- :patch => 2,
45
- :prerelease => nil,
46
- :build => "49.g21353f0.1",
47
- :release? => false,
48
- :prerelease? => false,
49
- :build? => true,
50
- :release_build? => true,
51
- :prerelease_build? => false,
52
- :commits_since => 49,
53
- :commit_sha => "21353f0",
54
- :iteration => 1
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
- "10.16.2.rc.1-49-g21353f0-1" => {
57
- :major => 10,
58
- :minor => 16,
59
- :patch => 2,
60
- :prerelease => "rc.1",
61
- :build => "49.g21353f0.1",
62
- :release? => false,
63
- :prerelease? => false,
64
- :build? => true,
65
- :release_build? => false,
66
- :prerelease_build? => true,
67
- :commits_since => 49,
68
- :commit_sha => "21353f0",
69
- :iteration => 1
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
- "10.16.2-alpha-49-g21353f0-1" => {
72
- :major => 10,
73
- :minor => 16,
74
- :patch => 2,
75
- :prerelease => "alpha",
76
- :build => "49.g21353f0.1",
77
- :release? => false,
78
- :prerelease? => false,
79
- :build? => true,
80
- :release_build? => false,
81
- :prerelease_build? => true,
82
- :commits_since => 49,
83
- :commit_sha => "21353f0",
84
- :iteration => 1
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 "rejects invalid version strings", {
104
- "1.0.0" => "no git describe data",
105
- "1.0.0-alpha.1" => "no git describe data",
106
- "1.0.0-alpha.1+build.deadbeef" => "no git describe data",
107
- "1.0.0-123-gfd0e3a65282cb5f6df3bab6a53f4fcb722340d499-1" => "too many SHA1 characters",
108
- "1.0.0-123-gdeadbe-1" => "too few SHA1 characters",
109
- "1.0.0-123-gNOTHEX1-1" => "illegal SHA1 characters",
110
- "1.0.0-123-g1234567-alpha" => "non-numeric iteration",
111
- "1.0.0-alpha-poop-g1234567-1" => "non-numeric 'commits_since'",
112
- "1.0.0-g1234567-1" => "missing 'commits_since'",
113
- "1.0.0-123-1" => "missing SHA1"
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 "serializable", version_strings
128
+ it_has_behavior 'serializable', version_strings
130
129
 
131
- it_has_behavior "sortable" do
132
- let(:unsorted_version_strings){ version_strings }
133
- let(:sorted_version_strings){%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
- let(:min){ "9.0.1-1-gdeadbee-1" }
146
- let(:max){ "10.20.2-3-gaaaaaaa-1" }
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 "filterable" do
151
- let(:unsorted_version_strings){ version_strings }
152
- let(:build_versions){%w{
153
- 9.0.1-1-gdeadbee-1
154
- 9.1.2-2-g1234567-1
155
- 10.0.0-1-gabcdef3-1
156
- 10.5.7-2-g21353f0-1
157
- 10.20.2-2-gbbbbbbb-1
158
- 10.20.2-3-gaaaaaaa-1
159
- 9.0.1-2-gdeadbe1-1
160
- 9.0.1-2-gdeadbe1-2
161
- 9.0.1-2-gdeadbe2-1
162
- 9.1.1-2-g1234567-1
163
- }}
164
- let(:release_build_versions){%w{
165
- 9.0.1-1-gdeadbee-1
166
- 9.1.2-2-g1234567-1
167
- 10.0.0-1-gabcdef3-1
168
- 10.5.7-2-g21353f0-1
169
- 10.20.2-2-gbbbbbbb-1
170
- 10.20.2-3-gaaaaaaa-1
171
- 9.0.1-2-gdeadbe1-1
172
- 9.0.1-2-gdeadbe1-2
173
- 9.0.1-2-gdeadbe2-1
174
- 9.1.1-2-g1234567-1
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