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
data/spec/spec_helper.rb
CHANGED
@@ -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
|
#
|
@@ -38,6 +38,6 @@ RSpec.configure do |config|
|
|
38
38
|
|
39
39
|
# specify metadata with symobls only (ie no '=> true' required)
|
40
40
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
41
|
-
config.filter_run :
|
41
|
+
config.filter_run focus: true
|
42
42
|
config.run_all_when_everything_filtered = true
|
43
43
|
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
|
#
|
@@ -16,27 +16,25 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
shared_examples
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
19
|
+
shared_examples 'Basic SemVer' do
|
20
|
+
it_has_behavior 'parses valid version strings', {
|
21
|
+
'1.2.3' => {
|
22
|
+
major: 1,
|
23
|
+
minor: 2,
|
24
|
+
patch: 3,
|
25
|
+
prerelease: nil,
|
26
|
+
build: nil,
|
27
|
+
release?: true,
|
28
|
+
prerelease?: false,
|
29
|
+
build?: false,
|
30
|
+
release_build?: false,
|
31
|
+
prerelease_build?: false,
|
32
|
+
},
|
34
33
|
}
|
35
34
|
|
36
|
-
it_has_behavior
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
it_has_behavior 'rejects invalid version strings', {
|
36
|
+
'a.1.1' => 'non-numeric MAJOR',
|
37
|
+
'1.a.1' => 'non-numeric MINOR',
|
38
|
+
'1.1.a' => 'non-numeric PATCH',
|
40
39
|
}
|
41
|
-
|
42
40
|
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Krzysztof Wilczynski (<kwilczynski@chef.io>)
|
3
|
+
# Copyright:: Copyright (c) 2014 Chef Software, Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
shared_examples 'comparable' do |version_matrix|
|
20
|
+
describe '#<' do
|
21
|
+
version_matrix.each_slice(2) do |a, b|
|
22
|
+
it "confirms that #{a} is less-than #{b}" do
|
23
|
+
expect(described_class.new(a) < b).to be true
|
24
|
+
expect(described_class.new(a) > b).to be false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#<=' do
|
30
|
+
version_matrix.each_slice(2) do |a, b|
|
31
|
+
it "confirms that #{a} less-than or equal to #{b}" do
|
32
|
+
expect(described_class.new(a) <= b).to be true
|
33
|
+
expect(described_class.new(a) <= a).to be true
|
34
|
+
expect(described_class.new(a) > b).to be false
|
35
|
+
expect(described_class.new(a) == b).to be false
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '#==' do
|
41
|
+
version_matrix.each do |v|
|
42
|
+
it "confirms that #{v} is equal to #{v}" do
|
43
|
+
expect(described_class.new(v) == v).to be true
|
44
|
+
expect(described_class.new(v) < v).to be false
|
45
|
+
expect(described_class.new(v) > v).to be false
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe '#>' do
|
51
|
+
version_matrix.reverse.each_slice(2) do |a, b|
|
52
|
+
it "confirms that #{a} is greather-than #{b}" do
|
53
|
+
expect(described_class.new(a) > b).to be true
|
54
|
+
expect(described_class.new(a) < b).to be false
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
describe '#>=' do
|
60
|
+
version_matrix.reverse.each_slice(2) do |a, b|
|
61
|
+
it "confirms that #{a} greater-than or equal to #{b}" do
|
62
|
+
expect(described_class.new(a) >= b).to be true
|
63
|
+
expect(described_class.new(a) >= a).to be true
|
64
|
+
expect(described_class.new(a) < b).to be false
|
65
|
+
expect(described_class.new(a) == b).to be false
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe '#between?' do
|
71
|
+
let(:versions) { version_matrix.map { |v| described_class.new(v) }.sort }
|
72
|
+
|
73
|
+
it 'comfirms that a version is between the oldest and latest release' do
|
74
|
+
min, max = versions.minmax.map(&:to_s)
|
75
|
+
middle = versions[versions.size / 2].to_s
|
76
|
+
expect(described_class.new(middle).between?(min, max)).to be true
|
77
|
+
expect(described_class.new(middle).between?(max, min)).to be false
|
78
|
+
end
|
79
|
+
end
|
80
|
+
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
|
#
|
@@ -16,51 +16,39 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
shared_examples
|
20
|
-
|
19
|
+
shared_examples 'filterable' do
|
21
20
|
let(:unsorted_versions) do
|
22
|
-
unsorted_version_strings.map{ |v| described_class.new(v) }
|
21
|
+
unsorted_version_strings.map { |v| described_class.new(v) }
|
23
22
|
end
|
24
23
|
|
25
24
|
# this should/will be overriden by calling spec
|
26
|
-
let(:release_versions){[]}
|
27
|
-
let(:prerelease_versions){[]}
|
28
|
-
let(:build_versions){[]}
|
29
|
-
let(:release_build_versions){[]}
|
30
|
-
let(:prerelease_build_versions){[]}
|
31
|
-
|
32
|
-
it
|
33
|
-
unsorted_versions.select(&:release?).should eq(release_versions.map{|v|
|
34
|
-
described_class.new(v)
|
35
|
-
})
|
25
|
+
let(:release_versions) { [] }
|
26
|
+
let(:prerelease_versions) { [] }
|
27
|
+
let(:build_versions) { [] }
|
28
|
+
let(:release_build_versions) { [] }
|
29
|
+
let(:prerelease_build_versions) { [] }
|
30
|
+
|
31
|
+
it 'filters by release versions only' do
|
32
|
+
unsorted_versions.select(&:release?).should eq(release_versions.map { |v| described_class.new(v) })
|
36
33
|
end # it
|
37
34
|
|
38
|
-
it
|
35
|
+
it 'filters by pre-release versions only' do
|
39
36
|
filtered = unsorted_versions.select(&:prerelease?)
|
40
|
-
filtered.should eq(prerelease_versions.map{|v|
|
41
|
-
described_class.new(v)
|
42
|
-
})
|
37
|
+
filtered.should eq(prerelease_versions.map { |v| described_class.new(v) })
|
43
38
|
end # it
|
44
39
|
|
45
|
-
it
|
40
|
+
it 'filters by build versions only' do
|
46
41
|
filtered = unsorted_versions.select(&:build?)
|
47
|
-
filtered.should eq(build_versions.map{|v|
|
48
|
-
described_class.new(v)
|
49
|
-
})
|
42
|
+
filtered.should eq(build_versions.map { |v| described_class.new(v) })
|
50
43
|
end # it
|
51
44
|
|
52
|
-
it
|
45
|
+
it 'filters by release build versions only' do
|
53
46
|
filtered = unsorted_versions.select(&:release_build?)
|
54
|
-
filtered.should eq(release_build_versions.map{|v|
|
55
|
-
described_class.new(v)
|
56
|
-
})
|
47
|
+
filtered.should eq(release_build_versions.map { |v| described_class.new(v) })
|
57
48
|
end # it
|
58
49
|
|
59
|
-
it
|
50
|
+
it 'filters by pre-release build versions only' do
|
60
51
|
filtered = unsorted_versions.select(&:prerelease_build?)
|
61
|
-
filtered.should eq(prerelease_build_versions.map{|v|
|
62
|
-
described_class.new(v)
|
63
|
-
})
|
52
|
+
filtered.should eq(prerelease_build_versions.map { |v| described_class.new(v) })
|
64
53
|
end # it
|
65
|
-
|
66
54
|
end # shared_examples
|
@@ -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
|
#
|
@@ -16,17 +16,14 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
shared_examples
|
20
|
-
|
19
|
+
shared_examples 'parses valid version strings' do |valid_examples|
|
21
20
|
valid_examples.each do |version, options|
|
22
|
-
|
23
21
|
context version do
|
24
|
-
let(:version_string){ version }
|
22
|
+
let(:version_string) { version }
|
25
23
|
|
26
24
|
options.each_pair do |name, value|
|
27
|
-
its(name){ should eq value}
|
25
|
+
its(name) { should eq value }
|
28
26
|
end
|
29
|
-
|
30
27
|
end # context
|
31
28
|
end # valid_examples
|
32
29
|
end # shared_examples
|
@@ -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
|
#
|
@@ -16,17 +16,14 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
shared_examples
|
20
|
-
|
19
|
+
shared_examples 'rejects invalid version strings' do |invalid_examples|
|
21
20
|
invalid_examples.each_pair do |version, reason|
|
22
|
-
|
23
21
|
context version do
|
24
|
-
let(:version_string){ version }
|
22
|
+
let(:version_string) { version }
|
25
23
|
|
26
24
|
it "fails because: #{reason}" do
|
27
25
|
expect { subject }.to raise_error(Mixlib::Versioning::ParseError)
|
28
26
|
end
|
29
|
-
|
30
27
|
end # context
|
31
28
|
end # invalid_examples
|
32
29
|
end # shared_examples
|
@@ -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
|
#
|
@@ -16,9 +16,8 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
shared_examples
|
20
|
-
|
21
|
-
describe "#to_s" do
|
19
|
+
shared_examples 'serializable' do |version_strings|
|
20
|
+
describe '#to_s' do
|
22
21
|
version_strings.each do |v|
|
23
22
|
it "reconstructs the initial input for #{v}" do
|
24
23
|
described_class.new(v).to_s.should == v
|
@@ -26,7 +25,7 @@ shared_examples "serializable" do |version_strings|
|
|
26
25
|
end # version_strings
|
27
26
|
end # describe
|
28
27
|
|
29
|
-
describe
|
28
|
+
describe '#to_semver_string' do
|
30
29
|
version_strings.each do |v|
|
31
30
|
it "generates a semver version string for #{v}" do
|
32
31
|
subject = described_class.new(v)
|
@@ -37,7 +36,7 @@ shared_examples "serializable" do |version_strings|
|
|
37
36
|
end # version_strings
|
38
37
|
end # describe
|
39
38
|
|
40
|
-
describe
|
39
|
+
describe '#to_rubygems_string' do
|
41
40
|
version_strings.each do |v|
|
42
41
|
it "generates a rubygems version string for #{v}" do
|
43
42
|
subject = described_class.new(v)
|
@@ -47,5 +46,4 @@ shared_examples "serializable" do |version_strings|
|
|
47
46
|
end # it
|
48
47
|
end # version_strings
|
49
48
|
end # describe
|
50
|
-
|
51
49
|
end # shared_examples
|
@@ -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
|
#
|
@@ -16,30 +16,28 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
shared_examples
|
20
|
-
|
19
|
+
shared_examples 'sortable' do
|
21
20
|
let(:unsorted_versions) do
|
22
|
-
unsorted_version_strings.map{ |v| described_class.new(v) }
|
21
|
+
unsorted_version_strings.map { |v| described_class.new(v) }
|
23
22
|
end
|
24
23
|
|
25
24
|
let(:sorted_versions) do
|
26
|
-
sorted_version_strings.map{ |v| described_class.new(v) }
|
25
|
+
sorted_version_strings.map { |v| described_class.new(v) }
|
27
26
|
end
|
28
27
|
|
29
28
|
it 'responds to <=>' do
|
30
29
|
described_class.should respond_to(:<=>)
|
31
30
|
end
|
32
31
|
|
33
|
-
it
|
32
|
+
it 'sorts all properly' do
|
34
33
|
unsorted_versions.sort.should eq sorted_versions
|
35
34
|
end
|
36
35
|
|
37
|
-
it
|
36
|
+
it 'finds the min' do
|
38
37
|
unsorted_versions.min.should eq described_class.new(min)
|
39
38
|
end
|
40
39
|
|
41
|
-
it
|
40
|
+
it 'finds the max' do
|
42
41
|
unsorted_versions.max.should eq described_class.new(max)
|
43
42
|
end
|
44
|
-
|
45
43
|
end # shared_examples
|
@@ -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,87 +19,99 @@
|
|
19
19
|
require 'mixlib/versioning'
|
20
20
|
|
21
21
|
shared_examples Mixlib::Versioning::Format::SemVer do
|
22
|
+
it_should_behave_like 'Basic SemVer'
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
24
|
+
it_has_behavior 'parses valid version strings', {
|
25
|
+
'1.0.0-alpha.1' => {
|
26
|
+
major: 1,
|
27
|
+
minor: 0,
|
28
|
+
patch: 0,
|
29
|
+
prerelease: 'alpha.1',
|
30
|
+
build: nil,
|
31
|
+
release?: false,
|
32
|
+
prerelease?: true,
|
33
|
+
build?: false,
|
34
|
+
release_build?: false,
|
35
|
+
prerelease_build?: false,
|
36
|
+
},
|
37
|
+
'1.0.0+20130308110833' => {
|
38
|
+
major: 1,
|
39
|
+
minor: 0,
|
40
|
+
patch: 0,
|
41
|
+
prerelease: nil,
|
42
|
+
build: '20130308110833',
|
43
|
+
release?: false,
|
44
|
+
prerelease?: false,
|
45
|
+
build?: true,
|
46
|
+
release_build?: true,
|
47
|
+
prerelease_build?: false,
|
37
48
|
},
|
38
|
-
|
39
|
-
:
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
+
'1.0.0-beta.3+20130308110833' => {
|
50
|
+
major: 1,
|
51
|
+
minor: 0,
|
52
|
+
patch: 0,
|
53
|
+
prerelease: 'beta.3',
|
54
|
+
build: '20130308110833',
|
55
|
+
release?: false,
|
56
|
+
prerelease?: false,
|
57
|
+
build?: true,
|
58
|
+
release_build?: false,
|
59
|
+
prerelease_build?: true,
|
49
60
|
},
|
50
|
-
"1.0.0-beta.3+20130308110833" => {
|
51
|
-
:major => 1,
|
52
|
-
:minor => 0,
|
53
|
-
:patch => 0,
|
54
|
-
:prerelease => "beta.3",
|
55
|
-
:build => "20130308110833",
|
56
|
-
:release? => false,
|
57
|
-
:prerelease? => false,
|
58
|
-
:build? => true,
|
59
|
-
:release_build? => false,
|
60
|
-
:prerelease_build? => true
|
61
|
-
}
|
62
61
|
}
|
63
62
|
|
64
|
-
it_has_behavior
|
65
|
-
|
63
|
+
it_has_behavior 'rejects invalid version strings', {
|
64
|
+
'8.8.8.8' => 'too many segments: MAJOR.MINOR.PATCH.EXTRA',
|
65
|
+
'01.1.1' => 'leading zero invalid',
|
66
|
+
'1.01.1' => 'leading zero invalid',
|
67
|
+
'1.1.01' => 'leading zero invalid',
|
68
|
+
'1.0.0-' => 'empty prerelease identifier',
|
69
|
+
'1.0.0-alpha..' => 'empty prerelease identifier',
|
70
|
+
'1.0.0-01.02.03' => 'leading zero invalid',
|
71
|
+
'1.0.0-alpha.01' => 'leading zero invalid',
|
72
|
+
'6.3.1+' => 'empty build identifier',
|
73
|
+
'6.4.8-alpha.1.2.3+build.' => 'empty build identifier',
|
74
|
+
'4.0.000000000002-alpha.1' => 'leading zero invalid',
|
75
|
+
'007.2.3-rc.1+build.16' => 'leading zero invalid',
|
76
|
+
'12.0005.1-alpha.12' => 'leading zero invalid',
|
77
|
+
'12.2.10-beta.00000017' => 'leading zero invalid',
|
66
78
|
}
|
67
79
|
|
68
|
-
describe
|
69
|
-
context
|
70
|
-
let(:version_string){
|
71
|
-
its(:release?){ should be_true }
|
72
|
-
its(:prerelease?){ should be_false }
|
73
|
-
its(:build?){ should be_false }
|
74
|
-
its(:release_build?){ should be_false }
|
75
|
-
its(:prerelease_build?){ should be_false }
|
80
|
+
describe 'build qualification' do
|
81
|
+
context 'release version' do
|
82
|
+
let(:version_string) { '1.0.0' }
|
83
|
+
its(:release?) { should be_true }
|
84
|
+
its(:prerelease?) { should be_false }
|
85
|
+
its(:build?) { should be_false }
|
86
|
+
its(:release_build?) { should be_false }
|
87
|
+
its(:prerelease_build?) { should be_false }
|
76
88
|
end
|
77
89
|
|
78
|
-
context
|
79
|
-
let(:version_string){
|
80
|
-
its(:release?){ should be_false }
|
81
|
-
its(:prerelease?){ should be_true }
|
82
|
-
its(:build?){ should be_false }
|
83
|
-
its(:release_build?){ should be_false }
|
84
|
-
its(:prerelease_build?){ should be_false }
|
90
|
+
context 'pre-release version' do
|
91
|
+
let(:version_string) { '1.0.0-alpha.1' }
|
92
|
+
its(:release?) { should be_false }
|
93
|
+
its(:prerelease?) { should be_true }
|
94
|
+
its(:build?) { should be_false }
|
95
|
+
its(:release_build?) { should be_false }
|
96
|
+
its(:prerelease_build?) { should be_false }
|
85
97
|
end
|
86
98
|
|
87
|
-
context
|
88
|
-
let(:version_string){
|
89
|
-
its(:release?){ should be_false }
|
90
|
-
its(:prerelease?){ should be_false }
|
91
|
-
its(:build?){ should be_true }
|
92
|
-
its(:release_build?){ should be_false }
|
93
|
-
its(:prerelease_build?){ should be_true }
|
99
|
+
context 'pre-release build version' do
|
100
|
+
let(:version_string) { '1.0.0-alpha.1+20130308110833' }
|
101
|
+
its(:release?) { should be_false }
|
102
|
+
its(:prerelease?) { should be_false }
|
103
|
+
its(:build?) { should be_true }
|
104
|
+
its(:release_build?) { should be_false }
|
105
|
+
its(:prerelease_build?) { should be_true }
|
94
106
|
end
|
95
107
|
|
96
|
-
context
|
97
|
-
let(:version_string){
|
98
|
-
its(:release?){ should be_false }
|
99
|
-
its(:prerelease?){ should be_false }
|
100
|
-
its(:build?){ should be_true }
|
101
|
-
its(:release_build?){ should be_true }
|
102
|
-
its(:prerelease_build?){ should be_false }
|
108
|
+
context 'release build version' do
|
109
|
+
let(:version_string) { '1.0.0+20130308110833' }
|
110
|
+
its(:release?) { should be_false }
|
111
|
+
its(:prerelease?) { should be_false }
|
112
|
+
its(:build?) { should be_true }
|
113
|
+
its(:release_build?) { should be_true }
|
114
|
+
its(:prerelease_build?) { should be_false }
|
103
115
|
end
|
104
116
|
end
|
105
117
|
end
|