naturalsorter 3.0.13 → 3.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +1 -1
- data/lib/naturalsorter/version.rb +1 -1
- data/lib/versioncmp.rb +14 -2
- data/spec/naturalsorter/naturalsorter_spec.rb +80 -80
- data/spec/naturalsorter/version_tag_recognizer_spec.rb +90 -90
- data/spec/naturalsorter/versioncmp_spec.rb +116 -60
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99cf7219e287435ad7d1f71da79bd53727a1017e
|
4
|
+
data.tar.gz: 5d72f5b05da3d87fa50d7e15182421120189e77b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f1e54e6f62b500f482c98e07ad523f2aabe929f9458b974a224ae876d9e17bf6f6a296282d13032cc2900bed6a624f6730d592f943a8a23197a8fbcee3150b2
|
7
|
+
data.tar.gz: b59d4a2c2487a80e0cc383e15c623652d4b6b305ec4d2a7363e068c516fcc88e0a99ed702d7ece1dc4552d5ac01fbd5c113d11f109eedaeb0098fed4f1c57375
|
data/README.markdown
CHANGED
data/lib/versioncmp.rb
CHANGED
@@ -29,14 +29,26 @@ class Versioncmp
|
|
29
29
|
#
|
30
30
|
def self.compare(a_val, b_val)
|
31
31
|
|
32
|
-
a_empty = a_val.
|
33
|
-
b_empty = b_val.
|
32
|
+
a_empty = a_val.to_s.empty?
|
33
|
+
b_empty = b_val.to_s.empty?
|
34
34
|
|
35
35
|
return 0 if a_empty && b_empty
|
36
36
|
return 0 if a_val.eql?( b_val )
|
37
37
|
return 1 if (a_empty == false) && (b_empty == true )
|
38
38
|
return -1 if (b_empty == false) && (a_empty == true )
|
39
39
|
|
40
|
+
return 1 if b_val.length > a_val.length && b_val.match(/\A#{a_val}-SNAPSHOT/i)
|
41
|
+
return -1 if a_val.length > b_val.length && a_val.match(/\A#{a_val}-SNAPSHOT/i)
|
42
|
+
|
43
|
+
return 1 if b_val.length > a_val.length && b_val.match(/\A#{a_val}-BETA.*/i)
|
44
|
+
return -1 if a_val.length > b_val.length && a_val.match(/\A#{a_val}-BETA.*/i)
|
45
|
+
|
46
|
+
return 1 if b_val.length > a_val.length && b_val.match(/\A#{a_val}-alpha.*/i)
|
47
|
+
return -1 if a_val.length > b_val.length && a_val.match(/\A#{a_val}-alpha.*/i)
|
48
|
+
|
49
|
+
return 1 if b_val.length > a_val.length && b_val.match(/\A#{a_val}-rc.*/i)
|
50
|
+
return -1 if a_val.length > b_val.length && a_val.match(/\A#{a_val}-rc.*/i)
|
51
|
+
|
40
52
|
a = pre_process a_val
|
41
53
|
b = pre_process b_val
|
42
54
|
|
@@ -5,38 +5,38 @@ describe Naturalsorter::Sorter do
|
|
5
5
|
|
6
6
|
describe "sort" do
|
7
7
|
it "cba is abc" do
|
8
|
-
Naturalsorter::Sorter.sort(["c", "b", "a"], true).
|
8
|
+
expect( Naturalsorter::Sorter.sort(["c", "b", "a"], true)).to eql(["a", "b", "c"])
|
9
9
|
end
|
10
10
|
it "is 2.2, 2.2.1-b03" do
|
11
|
-
Naturalsorter::Sorter.sort(["2.2.1-b03", "2.2"], true).
|
11
|
+
expect( Naturalsorter::Sorter.sort(["2.2.1-b03", "2.2"], true)).to eql(["2.2", "2.2.1-b03"])
|
12
12
|
end
|
13
13
|
it "c400b5a1 is a1b5c400" do
|
14
|
-
Naturalsorter::Sorter.sort(["a400", "a5", "a1"], true).
|
14
|
+
expect( Naturalsorter::Sorter.sort(["a400", "a5", "a1"], true)).to eql(["a1", "a5", "a400"])
|
15
15
|
end
|
16
16
|
it "1.5.2 is lower than 1.5.2-patch" do
|
17
|
-
Naturalsorter::Sorter.sort(["1.5.2", "1.4.4", "1.5.2-patch"], true).
|
17
|
+
expect( Naturalsorter::Sorter.sort(["1.5.2", "1.4.4", "1.5.2-patch"], true)).to eql(["1.4.4", "1.5.2", "1.5.2-patch"])
|
18
18
|
end
|
19
19
|
end
|
20
20
|
describe "sort_desc" do
|
21
21
|
it "cba is abc" do
|
22
|
-
Naturalsorter::Sorter.sort(["c", "b", "a"], true, false).
|
22
|
+
expect( Naturalsorter::Sorter.sort(["c", "b", "a"], true, false)).to eql(["c", "b", "a"])
|
23
23
|
end
|
24
24
|
it "c400b5a1 is a1b5c400" do
|
25
|
-
Naturalsorter::Sorter.sort(["a5", "a400", "a1"], true, false).
|
25
|
+
expect( Naturalsorter::Sorter.sort(["a5", "a400", "a1"], true, false)).to eql(["a400", "a5", "a1"])
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
describe "sort_by_method" do
|
30
30
|
it "c400b5a1 is a1b5c400" do
|
31
|
-
Naturalsorter::Sorter.sort_by_method(["a400", "a5", "a1"], "to_s", true).
|
31
|
+
expect( Naturalsorter::Sorter.sort_by_method(["a400", "a5", "a1"], "to_s", true)).to eql(["a1", "a5", "a400"])
|
32
32
|
end
|
33
33
|
it "1.5.2 is lower than 1.5.2-patch" do
|
34
|
-
Naturalsorter::Sorter.sort_by_method(["1.5.2-patch", "1.5.2", "1.4.4"], "to_s", true).
|
34
|
+
expect( Naturalsorter::Sorter.sort_by_method(["1.5.2-patch", "1.5.2", "1.4.4"], "to_s", true)).to eql(["1.4.4", "1.5.2", "1.5.2-patch"])
|
35
35
|
end
|
36
36
|
end
|
37
37
|
describe "sort_by_method_desc" do
|
38
38
|
it "a5 a400 a1 is a400 a5 a1" do
|
39
|
-
Naturalsorter::Sorter.sort_by_method(["a5", "a400", "a1"], "to_s", true, false).
|
39
|
+
expect( Naturalsorter::Sorter.sort_by_method(["a5", "a400", "a1"], "to_s", true, false)).to eql(["a400", "a5", "a1"])
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -44,154 +44,154 @@ describe Naturalsorter::Sorter do
|
|
44
44
|
describe "sort_version" do
|
45
45
|
|
46
46
|
it "1.1 is 1.1" do
|
47
|
-
Naturalsorter::Sorter.sort_version(["1.1"]).
|
47
|
+
expect( Naturalsorter::Sorter.sort_version(["1.1"])).to eql(["1.1"])
|
48
48
|
end
|
49
49
|
|
50
50
|
it "1.1 is bigger than 20030211.134440" do
|
51
|
-
Naturalsorter::Sorter.sort_version(["1.1", "20030211.134440"]).
|
51
|
+
expect( Naturalsorter::Sorter.sort_version(["1.1", "20030211.134440"])).to eql(["20030211.134440", "1.1"])
|
52
52
|
end
|
53
53
|
|
54
54
|
it "is 2.2.0, 2.2.1-b03" do
|
55
|
-
Naturalsorter::Sorter.sort_version(["2.2.1-b03", "2.2.0", ]).
|
55
|
+
expect( Naturalsorter::Sorter.sort_version(["2.2.1-b03", "2.2.0", ])).to eql(["2.2.0", "2.2.1-b03"])
|
56
56
|
end
|
57
57
|
|
58
58
|
it "is 2.2, 2.2.1-b03" do
|
59
|
-
Naturalsorter::Sorter.sort_version(["2.2.1-b03", "2.2", ]).
|
59
|
+
expect( Naturalsorter::Sorter.sort_version(["2.2.1-b03", "2.2", ])).to eql(["2.2", "2.2.1-b03"])
|
60
60
|
end
|
61
61
|
|
62
62
|
it "is 2.2.0-b03, 2.2.1-b03" do
|
63
|
-
Naturalsorter::Sorter.sort_version(["2.2.1-b03", "2.2.0-b03", ]).
|
63
|
+
expect( Naturalsorter::Sorter.sort_version(["2.2.1-b03", "2.2.0-b03", ])).to eql(["2.2.0-b03", "2.2.1-b03"])
|
64
64
|
end
|
65
65
|
|
66
66
|
it "1.1, 1.0 is 1.0, 1.1" do
|
67
|
-
Naturalsorter::Sorter.sort_version(["1.1", "1.0"]).
|
67
|
+
expect( Naturalsorter::Sorter.sort_version(["1.1", "1.0"])).to eql(["1.0", "1.1"])
|
68
68
|
end
|
69
69
|
|
70
70
|
it "1.0, 1.1 is 1.0, 1.1" do
|
71
|
-
Naturalsorter::Sorter.sort_version(["1.0", "1.1"]).
|
71
|
+
expect( Naturalsorter::Sorter.sort_version(["1.0", "1.1"])).to eql(["1.0", "1.1"])
|
72
72
|
end
|
73
73
|
|
74
74
|
it "4.5, 1.0 is 1.0, 4.5" do
|
75
|
-
Naturalsorter::Sorter.sort_version(["4.5", "1.0"]).
|
75
|
+
expect( Naturalsorter::Sorter.sort_version(["4.5", "1.0"])).to eql(["1.0", "4.5"])
|
76
76
|
end
|
77
77
|
|
78
78
|
it "1.0, 4.5 is 1.0, 4.5" do
|
79
|
-
Naturalsorter::Sorter.sort_version(["1.0", "4.5"]).
|
79
|
+
expect( Naturalsorter::Sorter.sort_version(["1.0", "4.5"])).to eql(["1.0", "4.5"])
|
80
80
|
end
|
81
81
|
|
82
82
|
it "1.2, 1.1 is 1.1, 1.2" do
|
83
|
-
Naturalsorter::Sorter.sort_version(["0.4", "0.1", "1.1", "1.2", "1.0"]).
|
83
|
+
expect( Naturalsorter::Sorter.sort_version(["0.4", "0.1", "1.1", "1.2", "1.0"])).to eql(["0.1", "0.4", "1.0", "1.1", "1.2"])
|
84
84
|
end
|
85
85
|
|
86
86
|
it "1.2, 1.1 is 1.1, 1.2" do
|
87
|
-
Naturalsorter::Sorter.sort_version( ["0.4", "0.1", "1.1", "1.2", "1.0", "1.0.RC1"]).
|
87
|
+
expect( Naturalsorter::Sorter.sort_version( ["0.4", "0.1", "1.1", "1.2", "1.0", "1.0.RC1"])).to eql(["0.1", "0.4", "1.0.RC1", "1.0", "1.1", "1.2"])
|
88
88
|
end
|
89
89
|
|
90
90
|
it "1.2, 1.1 is 1.1, 1.2" do
|
91
|
-
Naturalsorter::Sorter.sort_version(["0.4", "0.1", "1.1", "1.2", "1.0", "1.0.RC1"], false).
|
91
|
+
expect( Naturalsorter::Sorter.sort_version(["0.4", "0.1", "1.1", "1.2", "1.0", "1.0.RC1"], false)).to eql(["1.2", "1.1", "1.0", "1.0.RC1", "0.4", "0.1"])
|
92
92
|
end
|
93
93
|
|
94
94
|
it "1.2, 1.1 is 1.1, 1.2" do
|
95
|
-
Naturalsorter::Sorter.sort_version(["0.4", "0.1", "1.1", "1.1.1", "1.2", "1.2.1", "1.0", "1.0.RC1"], false).
|
95
|
+
expect( Naturalsorter::Sorter.sort_version(["0.4", "0.1", "1.1", "1.1.1", "1.2", "1.2.1", "1.0", "1.0.RC1"], false)).to eql(["1.2.1", "1.2", "1.1.1", "1.1", "1.0", "1.0.RC1", "0.4", "0.1"])
|
96
96
|
end
|
97
97
|
|
98
98
|
it "sorts this to the end 20040121.140929" do
|
99
|
-
Naturalsorter::Sorter.sort_version(["0.4", "0.1", "20040121.140929", "1.1.1", "1.2", "1.2.1", "1.0", "1.0.RC1"], false).
|
99
|
+
expect( Naturalsorter::Sorter.sort_version(["0.4", "0.1", "20040121.140929", "1.1.1", "1.2", "1.2.1", "1.0", "1.0.RC1"], false)).to eql(["1.2.1", "1.2", "1.1.1", "1.0", "1.0.RC1", "0.4", "0.1", "20040121.140929"])
|
100
100
|
end
|
101
101
|
|
102
102
|
it "1.2, 1.1 is 1.1, 1.2" do
|
103
|
-
Naturalsorter::Sorter.sort_version(["1.1", "1.2", "1.0"]).
|
103
|
+
expect( Naturalsorter::Sorter.sort_version(["1.1", "1.2", "1.0"])).to eql(["1.0", "1.1", "1.2"])
|
104
104
|
end
|
105
105
|
|
106
106
|
it "sort alphas and betas" do
|
107
|
-
Naturalsorter::Sorter.sort_version(["1.0.2", "1.0.1-b", "1.0.1-a"]).
|
107
|
+
expect( Naturalsorter::Sorter.sort_version(["1.0.2", "1.0.1-b", "1.0.1-a"])).to eql(["1.0.1-a", "1.0.1-b", "1.0.2"])
|
108
108
|
end
|
109
109
|
|
110
110
|
it "sort with RC" do
|
111
|
-
Naturalsorter::Sorter.sort_version(["1.1", "1.1.RC1"]).
|
111
|
+
expect( Naturalsorter::Sorter.sort_version(["1.1", "1.1.RC1"])).to eql(["1.1.RC1", "1.1"])
|
112
112
|
end
|
113
113
|
|
114
114
|
it "sort with RC" do
|
115
|
-
Naturalsorter::Sorter.sort_version(["1.1.RC1", "1.1", "1.0"]).
|
115
|
+
expect( Naturalsorter::Sorter.sort_version(["1.1.RC1", "1.1", "1.0"])).to eql(["1.0", "1.1.RC1", "1.1"])
|
116
116
|
end
|
117
117
|
|
118
118
|
it "sorts 2.1.0-beta11 higher than 2.1.0-beta9" do
|
119
|
-
Naturalsorter::Sorter.sort_version(["2.1.0-beta11", "2.1.0-beta9"]).
|
119
|
+
expect( Naturalsorter::Sorter.sort_version(["2.1.0-beta11", "2.1.0-beta9"])).to eql(["2.1.0-beta9", "2.1.0-beta11"])
|
120
120
|
end
|
121
121
|
|
122
122
|
it "1.5.2-patch is bigger than 1.5.2" do
|
123
|
-
Naturalsorter::Sorter.sort_version(["1.5.2", "1.4.4", "1.5.2-patch"]).
|
123
|
+
expect( Naturalsorter::Sorter.sort_version(["1.5.2", "1.4.4", "1.5.2-patch"])).to eql(["1.4.4", "1.5.2", "1.5.2-patch"])
|
124
124
|
end
|
125
125
|
|
126
126
|
end
|
127
127
|
|
128
128
|
describe "sort_version_by_method" do
|
129
129
|
it "1.5.2-patch is bigger than 1.5.2" do
|
130
|
-
Naturalsorter::Sorter.sort_version_by_method(["1.5.2", "1.4.4", "1.4.2", "1.5.2-patch2", "1.5.2-patch1"], 'to_s').
|
130
|
+
expect( Naturalsorter::Sorter.sort_version_by_method(["1.5.2", "1.4.4", "1.4.2", "1.5.2-patch2", "1.5.2-patch1"], 'to_s')).to eql(["1.4.2", "1.4.4", "1.5.2", "1.5.2-patch1", "1.5.2-patch2"])
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
134
|
describe "is_version_current?" do
|
135
135
|
it "returns true" do
|
136
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.9").
|
136
|
+
expect( Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.9")).to be_truthy
|
137
137
|
end
|
138
138
|
it "returns true" do
|
139
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.2").
|
139
|
+
expect( Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.2")).to be_truthy
|
140
140
|
end
|
141
141
|
it "returns true" do
|
142
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.12").
|
142
|
+
expect( Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.12")).to be_truthy
|
143
143
|
end
|
144
144
|
it "returns false" do
|
145
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.2.0").
|
145
|
+
expect( Naturalsorter::Sorter.is_version_current?("1.1.1", "1.2.0")).to be_falsey
|
146
146
|
end
|
147
147
|
it "returns false" do
|
148
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.2").
|
148
|
+
expect( Naturalsorter::Sorter.is_version_current?("1.1.1", "1.2")).to be_falsey
|
149
149
|
end
|
150
150
|
it "returns false" do
|
151
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "2.0").
|
151
|
+
expect( Naturalsorter::Sorter.is_version_current?("1.1.1", "2.0")).to be_falsey
|
152
152
|
end
|
153
153
|
it "returns false" do
|
154
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "2").
|
154
|
+
expect( Naturalsorter::Sorter.is_version_current?("1.1.1", "2")).to be_falsey
|
155
155
|
end
|
156
156
|
it "returns false" do
|
157
|
-
Naturalsorter::Sorter.is_version_current?("1.1", "2.0").
|
157
|
+
expect( Naturalsorter::Sorter.is_version_current?("1.1", "2.0")).to be_falsey
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
161
161
|
describe "get_newest_version" do
|
162
162
|
|
163
163
|
it "returns 2.0" do
|
164
|
-
Naturalsorter::Sorter.get_newest_version("1.1", "2.0").
|
164
|
+
expect( Naturalsorter::Sorter.get_newest_version("1.1", "2.0")).to eql("2.0")
|
165
165
|
end
|
166
166
|
it "returns 1.1" do
|
167
|
-
Naturalsorter::Sorter.get_newest_version("1.1", "1.0").
|
167
|
+
expect( Naturalsorter::Sorter.get_newest_version("1.1", "1.0")).to eql("1.1")
|
168
168
|
end
|
169
169
|
it "returns 4.5" do
|
170
|
-
Naturalsorter::Sorter.get_newest_version("4.5", "1.0").
|
170
|
+
expect( Naturalsorter::Sorter.get_newest_version("4.5", "1.0")).to eql("4.5")
|
171
171
|
end
|
172
172
|
it "returns 1.0" do
|
173
|
-
Naturalsorter::Sorter.get_newest_version("1.0", "1.0").
|
173
|
+
expect( Naturalsorter::Sorter.get_newest_version("1.0", "1.0")).to eql("1.0")
|
174
174
|
end
|
175
175
|
it "returns 1.10" do
|
176
|
-
Naturalsorter::Sorter.get_newest_version("1.10", "1.8").
|
176
|
+
expect( Naturalsorter::Sorter.get_newest_version("1.10", "1.8")).to eql("1.10")
|
177
177
|
end
|
178
178
|
it "returns 1.10" do
|
179
|
-
Naturalsorter::Sorter.get_newest_version("1.10", "v1.0").
|
179
|
+
expect( Naturalsorter::Sorter.get_newest_version("1.10", "v1.0")).to eql("1.10")
|
180
180
|
end
|
181
181
|
it "returns v1.10" do
|
182
|
-
Naturalsorter::Sorter.get_newest_version("v1.10", "v1.0").
|
182
|
+
expect( Naturalsorter::Sorter.get_newest_version("v1.10", "v1.0")).to eql("v1.10")
|
183
183
|
end
|
184
184
|
it "returns v1.10" do
|
185
|
-
Naturalsorter::Sorter.get_newest_version("v1.10", "1.0").
|
185
|
+
expect( Naturalsorter::Sorter.get_newest_version("v1.10", "1.0")).to eql("v1.10")
|
186
186
|
end
|
187
187
|
it "returns 1.10.x-dev" do
|
188
|
-
Naturalsorter::Sorter.get_newest_version("1.10.x-dev", "1.10.1").
|
188
|
+
expect( Naturalsorter::Sorter.get_newest_version("1.10.x-dev", "1.10.1")).to eql("1.10.x-dev")
|
189
189
|
end
|
190
190
|
it "returns still 1.10.x-dev" do
|
191
|
-
Naturalsorter::Sorter.get_newest_version("1.10.x-dev", "1.10.99").
|
191
|
+
expect( Naturalsorter::Sorter.get_newest_version("1.10.x-dev", "1.10.99")).to eql("1.10.x-dev")
|
192
192
|
end
|
193
193
|
it "returns still 1.11.1" do
|
194
|
-
Naturalsorter::Sorter.get_newest_version("1.10.x-dev", "1.11.1").
|
194
|
+
expect( Naturalsorter::Sorter.get_newest_version("1.10.x-dev", "1.11.1")).to eql("1.11.1")
|
195
195
|
end
|
196
196
|
|
197
197
|
end
|
@@ -199,25 +199,25 @@ describe Naturalsorter::Sorter do
|
|
199
199
|
describe "bigger?" do
|
200
200
|
|
201
201
|
it "returns true" do
|
202
|
-
Naturalsorter::Sorter.bigger?("1.1", "1.0").
|
202
|
+
expect( Naturalsorter::Sorter.bigger?("1.1", "1.0")).to be_truthy
|
203
203
|
end
|
204
204
|
it "returns true" do
|
205
|
-
Naturalsorter::Sorter.bigger?("1.1", "20030211.134440").
|
205
|
+
expect( Naturalsorter::Sorter.bigger?("1.1", "20030211.134440")).to be_truthy
|
206
206
|
end
|
207
207
|
it "returns true" do
|
208
|
-
Naturalsorter::Sorter.bigger?("1.1", "20030211").
|
208
|
+
expect( Naturalsorter::Sorter.bigger?("1.1", "20030211")).to be_truthy
|
209
209
|
end
|
210
210
|
it "returns true" do
|
211
|
-
Naturalsorter::Sorter.bigger?("2.0", "1.0").
|
211
|
+
expect( Naturalsorter::Sorter.bigger?("2.0", "1.0")).to be_truthy
|
212
212
|
end
|
213
213
|
it "returns true" do
|
214
|
-
Naturalsorter::Sorter.bigger?("2.20", "2.9").
|
214
|
+
expect( Naturalsorter::Sorter.bigger?("2.20", "2.9")).to be_truthy
|
215
215
|
end
|
216
216
|
it "returns false" do
|
217
|
-
Naturalsorter::Sorter.bigger?("2.20", "2.20").
|
217
|
+
expect( Naturalsorter::Sorter.bigger?("2.20", "2.20")).to be_falsey
|
218
218
|
end
|
219
219
|
it "returns false" do
|
220
|
-
Naturalsorter::Sorter.bigger?("2.20", "3.0").
|
220
|
+
expect( Naturalsorter::Sorter.bigger?("2.20", "3.0")).to be_falsey
|
221
221
|
end
|
222
222
|
|
223
223
|
end
|
@@ -225,31 +225,31 @@ describe Naturalsorter::Sorter do
|
|
225
225
|
describe "bigger_or_equal?" do
|
226
226
|
|
227
227
|
it "returns true" do
|
228
|
-
Naturalsorter::Sorter.bigger_or_equal?("1.1", "1.0").
|
228
|
+
expect( Naturalsorter::Sorter.bigger_or_equal?("1.1", "1.0")).to be_truthy
|
229
229
|
end
|
230
230
|
it "returns true" do
|
231
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.0", "1.0").
|
231
|
+
expect( Naturalsorter::Sorter.bigger_or_equal?("2.0", "1.0")).to be_truthy
|
232
232
|
end
|
233
233
|
it "returns true" do
|
234
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.9").
|
234
|
+
expect( Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.9")).to be_truthy
|
235
235
|
end
|
236
236
|
it "returns true" do
|
237
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20").
|
237
|
+
expect( Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20")).to be_truthy
|
238
238
|
end
|
239
239
|
it "returns true" do
|
240
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20.0").
|
240
|
+
expect( Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20.0")).to be_truthy
|
241
241
|
end
|
242
242
|
it "returns true" do
|
243
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20").
|
243
|
+
expect( Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20")).to be_truthy
|
244
244
|
end
|
245
245
|
it "returns true" do
|
246
|
-
Naturalsorter::Sorter.bigger_or_equal?("v3.2.0", "3.2.0").
|
246
|
+
expect( Naturalsorter::Sorter.bigger_or_equal?("v3.2.0", "3.2.0")).to be_truthy
|
247
247
|
end
|
248
248
|
it "returns true" do
|
249
|
-
Naturalsorter::Sorter.bigger_or_equal?("v3.2.0", "3.1.0").
|
249
|
+
expect( Naturalsorter::Sorter.bigger_or_equal?("v3.2.0", "3.1.0")).to be_truthy
|
250
250
|
end
|
251
251
|
it "returns false" do
|
252
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.20", "3.0").
|
252
|
+
expect( Naturalsorter::Sorter.bigger_or_equal?("2.20", "3.0")).to be_falsey
|
253
253
|
end
|
254
254
|
|
255
255
|
end
|
@@ -257,25 +257,25 @@ describe Naturalsorter::Sorter do
|
|
257
257
|
describe "smaller?" do
|
258
258
|
|
259
259
|
it "returns false" do
|
260
|
-
Naturalsorter::Sorter.smaller?("1.1", "1.0").
|
260
|
+
expect( Naturalsorter::Sorter.smaller?("1.1", "1.0")).to be_falsey
|
261
261
|
end
|
262
262
|
it "returns false" do
|
263
|
-
Naturalsorter::Sorter.smaller?("2.0", "1.0").
|
263
|
+
expect( Naturalsorter::Sorter.smaller?("2.0", "1.0")).to be_falsey
|
264
264
|
end
|
265
265
|
it "returns false" do
|
266
|
-
Naturalsorter::Sorter.smaller?("2.20", "2.9").
|
266
|
+
expect( Naturalsorter::Sorter.smaller?("2.20", "2.9")).to be_falsey
|
267
267
|
end
|
268
268
|
it "returns false" do
|
269
|
-
Naturalsorter::Sorter.smaller?("2.20", "2.20").
|
269
|
+
expect( Naturalsorter::Sorter.smaller?("2.20", "2.20")).to be_falsey
|
270
270
|
end
|
271
271
|
it "returns true" do
|
272
|
-
Naturalsorter::Sorter.smaller?("2.20", "3.0").
|
272
|
+
expect( Naturalsorter::Sorter.smaller?("2.20", "3.0")).to be_truthy
|
273
273
|
end
|
274
274
|
it "returns false" do
|
275
|
-
Naturalsorter::Sorter.smaller?("2.0", "2.0").
|
275
|
+
expect( Naturalsorter::Sorter.smaller?("2.0", "2.0")).to be_falsey
|
276
276
|
end
|
277
277
|
it "returns false" do
|
278
|
-
Naturalsorter::Sorter.smaller?("2.0", "2.0.0").
|
278
|
+
expect( Naturalsorter::Sorter.smaller?("2.0", "2.0.0")).to be_falsey
|
279
279
|
end
|
280
280
|
|
281
281
|
end
|
@@ -283,28 +283,28 @@ describe Naturalsorter::Sorter do
|
|
283
283
|
describe "smaller_or_equal?" do
|
284
284
|
|
285
285
|
it "returns false" do
|
286
|
-
Naturalsorter::Sorter.smaller_or_equal?("1.1", "1.0").
|
286
|
+
expect( Naturalsorter::Sorter.smaller_or_equal?("1.1", "1.0")).to be_falsey
|
287
287
|
end
|
288
288
|
it "returns false" do
|
289
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.0", "1.0").
|
289
|
+
expect( Naturalsorter::Sorter.smaller_or_equal?("2.0", "1.0")).to be_falsey
|
290
290
|
end
|
291
291
|
it "returns false" do
|
292
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.9").
|
292
|
+
expect( Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.9")).to be_falsey
|
293
293
|
end
|
294
294
|
it "returns false" do
|
295
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.20").
|
295
|
+
expect( Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.20")).to be_truthy
|
296
296
|
end
|
297
297
|
it "returns false" do
|
298
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20.0", "2.20").
|
298
|
+
expect( Naturalsorter::Sorter.smaller_or_equal?("2.20.0", "2.20")).to be_truthy
|
299
299
|
end
|
300
300
|
it "returns true" do
|
301
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.20").
|
301
|
+
expect( Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.20")).to be_truthy
|
302
302
|
end
|
303
303
|
it "returns true" do
|
304
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20", "3.0").
|
304
|
+
expect( Naturalsorter::Sorter.smaller_or_equal?("2.20", "3.0")).to be_truthy
|
305
305
|
end
|
306
306
|
it "returns true" do
|
307
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20", "v3.0").
|
307
|
+
expect( Naturalsorter::Sorter.smaller_or_equal?("2.20", "v3.0")).to be_truthy
|
308
308
|
end
|
309
309
|
|
310
310
|
end
|
@@ -4,358 +4,358 @@ require "naturalsorter"
|
|
4
4
|
describe VersionTagRecognizer do
|
5
5
|
|
6
6
|
it "release? is true" do
|
7
|
-
VersionTagRecognizer.release?("1.1").
|
7
|
+
expect( VersionTagRecognizer.release?("1.1")).to be_truthy
|
8
8
|
end
|
9
9
|
|
10
10
|
it "release? is true" do
|
11
|
-
VersionTagRecognizer.release?("1.0.0").
|
11
|
+
expect( VersionTagRecognizer.release?("1.0.0")).to be_truthy
|
12
12
|
end
|
13
13
|
|
14
14
|
it "release? is true" do
|
15
|
-
VersionTagRecognizer.release?("1").
|
15
|
+
expect( VersionTagRecognizer.release?("1")).to be_truthy
|
16
16
|
end
|
17
17
|
|
18
18
|
it "release? is true" do
|
19
|
-
VersionTagRecognizer.release?("3.3.2.GA").
|
19
|
+
expect( VersionTagRecognizer.release?("3.3.2.GA")).to be_truthy
|
20
20
|
end
|
21
21
|
|
22
22
|
it "release? is true" do
|
23
|
-
VersionTagRecognizer.release?("4.1.5.SP1").
|
23
|
+
expect( VersionTagRecognizer.release?("4.1.5.SP1")).to be_truthy
|
24
24
|
end
|
25
25
|
|
26
26
|
it "release? is true" do
|
27
|
-
VersionTagRecognizer.release?("3.1.0.RELEASE").
|
27
|
+
expect( VersionTagRecognizer.release?("3.1.0.RELEASE")).to be_truthy
|
28
28
|
end
|
29
29
|
|
30
30
|
it "release? is true" do
|
31
|
-
VersionTagRecognizer.release?("3.2.0.BUILD").
|
31
|
+
expect( VersionTagRecognizer.release?("3.2.0.BUILD")).to be_falsey
|
32
32
|
end
|
33
33
|
|
34
34
|
it "release? is true" do
|
35
|
-
VersionTagRecognizer.release?("3.2.0buiLd").
|
35
|
+
expect( VersionTagRecognizer.release?("3.2.0buiLd")).to be_falsey
|
36
36
|
end
|
37
37
|
|
38
38
|
it "release? is true" do
|
39
|
-
VersionTagRecognizer.release?("3.2.0.Final").
|
39
|
+
expect( VersionTagRecognizer.release?("3.2.0.Final")).to be_truthy
|
40
40
|
end
|
41
41
|
|
42
42
|
it "release? is true" do
|
43
|
-
VersionTagRecognizer.release?("3.2.0FINAL").
|
43
|
+
expect( VersionTagRecognizer.release?("3.2.0FINAL")).to be_truthy
|
44
44
|
end
|
45
45
|
|
46
46
|
it "release? is false" do
|
47
|
-
VersionTagRecognizer.release?("1.1.pre").
|
47
|
+
expect( VersionTagRecognizer.release?("1.1.pre")).to be_falsey
|
48
48
|
end
|
49
49
|
|
50
50
|
it "release? is false" do
|
51
|
-
VersionTagRecognizer.release?("2.5.6.SEC03").
|
51
|
+
expect( VersionTagRecognizer.release?("2.5.6.SEC03")).to be_falsey
|
52
52
|
end
|
53
53
|
|
54
54
|
it "release? is false" do
|
55
|
-
VersionTagRecognizer.release?("2.3.8.pre1").
|
55
|
+
expect( VersionTagRecognizer.release?("2.3.8.pre1")).to be_falsey
|
56
56
|
end
|
57
57
|
|
58
58
|
it "release? is false" do
|
59
|
-
VersionTagRecognizer.release?("2.3.9.pre").
|
59
|
+
expect( VersionTagRecognizer.release?("2.3.9.pre")).to be_falsey
|
60
60
|
end
|
61
61
|
|
62
62
|
it "release? is false" do
|
63
|
-
VersionTagRecognizer.release?("3.0.0.beta4").
|
63
|
+
expect( VersionTagRecognizer.release?("3.0.0.beta4")).to be_falsey
|
64
64
|
end
|
65
65
|
|
66
66
|
it "release? is false" do
|
67
|
-
VersionTagRecognizer.release?("3.0.0.BETA4").
|
67
|
+
expect( VersionTagRecognizer.release?("3.0.0.BETA4")).to be_falsey
|
68
68
|
end
|
69
69
|
|
70
70
|
it "release? is false" do
|
71
|
-
VersionTagRecognizer.release?("3.0.0.beta").
|
71
|
+
expect( VersionTagRecognizer.release?("3.0.0.beta")).to be_falsey
|
72
72
|
end
|
73
73
|
|
74
74
|
it "release? is false" do
|
75
|
-
VersionTagRecognizer.release?("3.0.0.rc").
|
75
|
+
expect( VersionTagRecognizer.release?("3.0.0.rc")).to be_falsey
|
76
76
|
end
|
77
77
|
|
78
78
|
it "release? is false" do
|
79
|
-
VersionTagRecognizer.release?("3.0.0.rc2").
|
79
|
+
expect( VersionTagRecognizer.release?("3.0.0.rc2")).to be_falsey
|
80
80
|
end
|
81
81
|
|
82
82
|
it "release? is false" do
|
83
|
-
VersionTagRecognizer.release?("3.0.0.RC2").
|
83
|
+
expect( VersionTagRecognizer.release?("3.0.0.RC2")).to be_falsey
|
84
84
|
end
|
85
85
|
|
86
86
|
it "release? is false" do
|
87
|
-
VersionTagRecognizer.release?("2.0.x-dev").
|
87
|
+
expect( VersionTagRecognizer.release?("2.0.x-dev")).to be_falsey
|
88
88
|
end
|
89
89
|
|
90
90
|
it "release? is false" do
|
91
|
-
VersionTagRecognizer.release?("2.0.x-DEV").
|
91
|
+
expect( VersionTagRecognizer.release?("2.0.x-DEV")).to be_falsey
|
92
92
|
end
|
93
93
|
|
94
94
|
it "release? is false" do
|
95
|
-
VersionTagRecognizer.release?("1.8b1").
|
95
|
+
expect( VersionTagRecognizer.release?("1.8b1")).to be_falsey
|
96
96
|
end
|
97
97
|
|
98
98
|
it "release? is false" do
|
99
|
-
VersionTagRecognizer.release?("1.8B1").
|
99
|
+
expect( VersionTagRecognizer.release?("1.8B1")).to be_falsey
|
100
100
|
end
|
101
101
|
|
102
102
|
it "release? is false" do
|
103
|
-
VersionTagRecognizer.release?("1.1.3a").
|
103
|
+
expect( VersionTagRecognizer.release?("1.1.3a")).to be_falsey
|
104
104
|
end
|
105
105
|
|
106
106
|
it "release? is false" do
|
107
|
-
VersionTagRecognizer.release?("1.1.3A").
|
107
|
+
expect( VersionTagRecognizer.release?("1.1.3A")).to be_falsey
|
108
108
|
end
|
109
109
|
|
110
110
|
it "release? is false" do
|
111
|
-
VersionTagRecognizer.release?("1.SNAPSHOT").
|
111
|
+
expect( VersionTagRecognizer.release?("1.SNAPSHOT")).to be_falsey
|
112
112
|
end
|
113
113
|
|
114
114
|
it "release? is false" do
|
115
|
-
VersionTagRecognizer.release?("1.snapshot").
|
115
|
+
expect( VersionTagRecognizer.release?("1.snapshot")).to be_falsey
|
116
116
|
end
|
117
117
|
|
118
118
|
it "release? is false" do
|
119
|
-
VersionTagRecognizer.release?("1.M1").
|
119
|
+
expect( VersionTagRecognizer.release?("1.M1")).to be_falsey
|
120
120
|
end
|
121
121
|
|
122
122
|
it "release? is false" do
|
123
|
-
VersionTagRecognizer.release?("2.0-m4").
|
123
|
+
expect( VersionTagRecognizer.release?("2.0-m4")).to be_falsey
|
124
124
|
end
|
125
125
|
|
126
126
|
it "release? is false" do
|
127
|
-
VersionTagRecognizer.release?("dev-garbage-collection-configuration").
|
127
|
+
expect( VersionTagRecognizer.release?("dev-garbage-collection-configuration")).to be_falsey
|
128
128
|
end
|
129
129
|
|
130
130
|
it "release? is false" do
|
131
|
-
VersionTagRecognizer.release?("garbage-collection-configuration-dev").
|
131
|
+
expect( VersionTagRecognizer.release?("garbage-collection-configuration-dev")).to be_falsey
|
132
132
|
end
|
133
133
|
|
134
134
|
|
135
135
|
|
136
136
|
it "is alpha? is true" do
|
137
|
-
VersionTagRecognizer.alpha?("2.0.alpha").
|
137
|
+
expect( VersionTagRecognizer.alpha?("2.0.alpha")).to be_truthy
|
138
138
|
end
|
139
139
|
|
140
140
|
it "is alpha? is true" do
|
141
|
-
VersionTagRecognizer.alpha?("2.1.0alpha").
|
141
|
+
expect( VersionTagRecognizer.alpha?("2.1.0alpha")).to be_truthy
|
142
142
|
end
|
143
143
|
|
144
144
|
it "is alpha? is false" do
|
145
|
-
VersionTagRecognizer.alpha?("2.0.1").
|
145
|
+
expect( VersionTagRecognizer.alpha?("2.0.1")).to be_falsey
|
146
146
|
end
|
147
147
|
|
148
148
|
it "is alpha? is false" do
|
149
|
-
VersionTagRecognizer.alpha?("2.1.0-BETA1").
|
149
|
+
expect( VersionTagRecognizer.alpha?("2.1.0-BETA1")).to be_falsey
|
150
150
|
end
|
151
151
|
|
152
152
|
it "is tagged? is true" do
|
153
|
-
VersionTagRecognizer.tagged?("2.1.0alpha").
|
153
|
+
expect( VersionTagRecognizer.tagged?("2.1.0alpha")).to be_truthy
|
154
154
|
end
|
155
155
|
|
156
156
|
|
157
157
|
|
158
158
|
it "remove_tag is right" do
|
159
|
-
VersionTagRecognizer.remove_tag("2.1.0alpha").
|
159
|
+
expect( VersionTagRecognizer.remove_tag("2.1.0alpha")).to eql("2.1")
|
160
160
|
end
|
161
161
|
it "remove_tag is right" do
|
162
|
-
VersionTagRecognizer.remove_tag("2.1.1-BETA").
|
162
|
+
expect( VersionTagRecognizer.remove_tag("2.1.1-BETA")).to eql("2.1")
|
163
163
|
end
|
164
164
|
it "remove_tag is right" do
|
165
|
-
VersionTagRecognizer.remove_tag("2.1.1-RC").
|
165
|
+
expect( VersionTagRecognizer.remove_tag("2.1.1-RC")).to eql("2.1")
|
166
166
|
end
|
167
167
|
it "remove_tag is right" do
|
168
|
-
VersionTagRecognizer.remove_tag("2.1.1-PRE").
|
168
|
+
expect( VersionTagRecognizer.remove_tag("2.1.1-PRE")).to eql("2.1")
|
169
169
|
end
|
170
170
|
|
171
171
|
|
172
172
|
|
173
173
|
it "is beta? is true" do
|
174
|
-
VersionTagRecognizer.beta?("2.0.beta").
|
174
|
+
expect( VersionTagRecognizer.beta?("2.0.beta")).to be_truthy
|
175
175
|
end
|
176
176
|
|
177
177
|
it "is beta? is true" do
|
178
|
-
VersionTagRecognizer.beta?("2.1.0beta").
|
178
|
+
expect( VersionTagRecognizer.beta?("2.1.0beta")).to be_truthy
|
179
179
|
end
|
180
180
|
|
181
181
|
it "is beta? is false" do
|
182
|
-
VersionTagRecognizer.beta?("2.0.1").
|
182
|
+
expect( VersionTagRecognizer.beta?("2.0.1")).to be_falsey
|
183
183
|
end
|
184
184
|
|
185
185
|
it "is beta? is true" do
|
186
|
-
VersionTagRecognizer.beta?("2.2.0-BETA2").
|
186
|
+
expect( VersionTagRecognizer.beta?("2.2.0-BETA2")).to be_truthy
|
187
187
|
end
|
188
188
|
|
189
189
|
it "is beta? is true" do
|
190
|
-
VersionTagRecognizer.beta?("2.1.0-BETA1").
|
190
|
+
expect( VersionTagRecognizer.beta?("2.1.0-BETA1")).to be_truthy
|
191
191
|
end
|
192
192
|
|
193
193
|
it "is tagged? is true" do
|
194
|
-
VersionTagRecognizer.tagged?("2.1.0-BETA1").
|
194
|
+
expect( VersionTagRecognizer.tagged?("2.1.0-BETA1")).to be_truthy
|
195
195
|
end
|
196
196
|
|
197
197
|
it "remove_tag is right" do
|
198
|
-
VersionTagRecognizer.remove_tag("2.1.0-BETA1").
|
198
|
+
expect( VersionTagRecognizer.remove_tag("2.1.0-BETA1")).to eql("2.1")
|
199
199
|
end
|
200
200
|
|
201
201
|
|
202
202
|
|
203
203
|
it "is dev? is true" do
|
204
|
-
VersionTagRecognizer.dev?("dev-master").
|
204
|
+
expect( VersionTagRecognizer.dev?("dev-master")).to be_truthy
|
205
205
|
end
|
206
206
|
|
207
207
|
it "is dev? is true" do
|
208
|
-
VersionTagRecognizer.dev?("dev-progress-helper").
|
208
|
+
expect( VersionTagRecognizer.dev?("dev-progress-helper")).to be_truthy
|
209
209
|
end
|
210
210
|
|
211
211
|
it "is dev? is true" do
|
212
|
-
VersionTagRecognizer.dev?("dev-deprecated").
|
212
|
+
expect( VersionTagRecognizer.dev?("dev-deprecated")).to be_truthy
|
213
213
|
end
|
214
214
|
|
215
215
|
it "is dev? is true" do
|
216
|
-
VersionTagRecognizer.dev?("2.2.x-dev").
|
216
|
+
expect( VersionTagRecognizer.dev?("2.2.x-dev")).to be_truthy
|
217
217
|
end
|
218
218
|
|
219
219
|
it "is dev? is false" do
|
220
|
-
VersionTagRecognizer.dev?("2.0.1").
|
220
|
+
expect( VersionTagRecognizer.dev?("2.0.1")).to be_falsey
|
221
221
|
end
|
222
222
|
|
223
223
|
|
224
224
|
|
225
225
|
it "is rc? is true" do
|
226
|
-
VersionTagRecognizer.rc?("2.0.rc").
|
226
|
+
expect( VersionTagRecognizer.rc?("2.0.rc")).to be_truthy
|
227
227
|
end
|
228
228
|
|
229
229
|
it "is rc? is true" do
|
230
|
-
VersionTagRecognizer.rc?("2.1.0rc").
|
230
|
+
expect( VersionTagRecognizer.rc?("2.1.0rc")).to be_truthy
|
231
231
|
end
|
232
232
|
|
233
233
|
it "is rc? is true" do
|
234
|
-
VersionTagRecognizer.rc?("2.2.0-RC3").
|
234
|
+
expect( VersionTagRecognizer.rc?("2.2.0-RC3")).to be_truthy
|
235
235
|
end
|
236
236
|
|
237
237
|
it "is rc? is false" do
|
238
|
-
VersionTagRecognizer.rc?("2.0.1").
|
238
|
+
expect( VersionTagRecognizer.rc?("2.0.1")).to be_falsey
|
239
239
|
end
|
240
240
|
|
241
241
|
|
242
242
|
|
243
243
|
it "is snapshot? is true" do
|
244
|
-
VersionTagRecognizer.snapshot?("2.0.snapshot").
|
244
|
+
expect( VersionTagRecognizer.snapshot?("2.0.snapshot")).to be_truthy
|
245
245
|
end
|
246
246
|
|
247
247
|
it "is snapshot? is true" do
|
248
|
-
VersionTagRecognizer.snapshot?("2.1.0snapshot").
|
248
|
+
expect( VersionTagRecognizer.snapshot?("2.1.0snapshot")).to be_truthy
|
249
249
|
end
|
250
250
|
|
251
251
|
it "is snapshot? is true" do
|
252
|
-
VersionTagRecognizer.snapshot?("2.2.0-snapshot3").
|
252
|
+
expect( VersionTagRecognizer.snapshot?("2.2.0-snapshot3")).to be_truthy
|
253
253
|
end
|
254
254
|
|
255
255
|
it "is snapshot? is false" do
|
256
|
-
VersionTagRecognizer.snapshot?("2.0.1").
|
256
|
+
expect( VersionTagRecognizer.snapshot?("2.0.1")).to be_falsey
|
257
257
|
end
|
258
258
|
|
259
259
|
|
260
260
|
it 'is a build' do
|
261
|
-
VersionTagRecognizer.build?("1.3.0-build.2921+sha.02c0ed2").
|
261
|
+
expect( VersionTagRecognizer.build?("1.3.0-build.2921+sha.02c0ed2")).to be_truthy
|
262
262
|
end
|
263
263
|
|
264
264
|
|
265
265
|
it "returns the right value for dev" do
|
266
|
-
VersionTagRecognizer.value_for("1.1.1-dev").
|
266
|
+
expect( VersionTagRecognizer.value_for("1.1.1-dev")).to eql(0)
|
267
267
|
end
|
268
268
|
it "returns the right value for snapshot" do
|
269
|
-
VersionTagRecognizer.value_for("1.1.1-SNAPSHOT").
|
269
|
+
expect( VersionTagRecognizer.value_for("1.1.1-SNAPSHOT")).to eql(2)
|
270
270
|
end
|
271
271
|
it "returns the right value for alpha" do
|
272
|
-
VersionTagRecognizer.value_for("1.1.1-alpha").
|
272
|
+
expect( VersionTagRecognizer.value_for("1.1.1-alpha")).to eql(3)
|
273
273
|
end
|
274
274
|
it "returns the right value for beta" do
|
275
|
-
VersionTagRecognizer.value_for("1.1.1-beta").
|
275
|
+
expect( VersionTagRecognizer.value_for("1.1.1-beta")).to eql(4)
|
276
276
|
end
|
277
277
|
it "returns the right value for rc" do
|
278
|
-
VersionTagRecognizer.value_for("1.1.1-rc").
|
278
|
+
expect( VersionTagRecognizer.value_for("1.1.1-rc")).to eql(5)
|
279
279
|
end
|
280
280
|
it "returns the right value for pre" do
|
281
|
-
VersionTagRecognizer.value_for("1.1.1-pre").
|
281
|
+
expect( VersionTagRecognizer.value_for("1.1.1-pre")).to eql(6)
|
282
282
|
end
|
283
283
|
it "returns the right value for stable" do
|
284
|
-
VersionTagRecognizer.value_for("1.1.1").
|
284
|
+
expect( VersionTagRecognizer.value_for("1.1.1")).to eql(10)
|
285
285
|
end
|
286
286
|
|
287
287
|
|
288
288
|
|
289
289
|
it "returns compares right for alpha and beta" do
|
290
|
-
VersionTagRecognizer.compare_tags("1.1.1-alpha", "1.1.1-beta").
|
290
|
+
expect( VersionTagRecognizer.compare_tags("1.1.1-alpha", "1.1.1-beta")).to eql(-1)
|
291
291
|
end
|
292
292
|
it "returns compares right for beta and alpha" do
|
293
|
-
VersionTagRecognizer.compare_tags("1.1.1-beta", "1.1.1-alpha").
|
293
|
+
expect( VersionTagRecognizer.compare_tags("1.1.1-beta", "1.1.1-alpha")).to eql(1)
|
294
294
|
end
|
295
295
|
it "returns compares right for alpha and alpha" do
|
296
|
-
VersionTagRecognizer.compare_tags("1.1.1-alpha", "1.1.1-alpha").
|
296
|
+
expect( VersionTagRecognizer.compare_tags("1.1.1-alpha", "1.1.1-alpha")).to eql(0)
|
297
297
|
end
|
298
298
|
it "returns compares right for RC and stable" do
|
299
|
-
VersionTagRecognizer.compare_tags("1.1.1-RC", "1.1.1").
|
299
|
+
expect( VersionTagRecognizer.compare_tags("1.1.1-RC", "1.1.1")).to eql(-1)
|
300
300
|
end
|
301
301
|
it "returns compares right for stable and dev" do
|
302
|
-
VersionTagRecognizer.compare_tags("1.1.1", "1.1.x-dev").
|
302
|
+
expect( VersionTagRecognizer.compare_tags("1.1.1", "1.1.x-dev")).to eql(1)
|
303
303
|
end
|
304
304
|
|
305
305
|
|
306
306
|
|
307
307
|
it "does fit stability" do
|
308
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.1", "stable" ).
|
308
|
+
expect( VersionTagRecognizer.does_it_fit_stability?( "2.2.1", "stable" )).to be_truthy
|
309
309
|
end
|
310
310
|
it "does not fit stability" do
|
311
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "stable" ).
|
311
|
+
expect( VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "stable" )).to be_falsey
|
312
312
|
end
|
313
313
|
it "does not fit stability" do
|
314
|
-
VersionTagRecognizer.does_it_fit_stability?( "1.3.0-build.2921+sha.02c0ed2", "stable" ).
|
314
|
+
expect( VersionTagRecognizer.does_it_fit_stability?( "1.3.0-build.2921+sha.02c0ed2", "stable" )).to be_falsey
|
315
315
|
end
|
316
316
|
it "does not fit stability" do
|
317
|
-
VersionTagRecognizer.does_it_fit_stability?( "1.3.0-build.2809+sha.94bcc03", "stable" ).
|
317
|
+
expect( VersionTagRecognizer.does_it_fit_stability?( "1.3.0-build.2809+sha.94bcc03", "stable" )).to be_falsey
|
318
318
|
end
|
319
319
|
it "does fit stability" do
|
320
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "alpha" ).
|
320
|
+
expect( VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "alpha" )).to be_truthy
|
321
321
|
end
|
322
322
|
it "does fit stability" do
|
323
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "beta" ).
|
323
|
+
expect( VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "beta" )).to be_truthy
|
324
324
|
end
|
325
325
|
it "does fit stability" do
|
326
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "dev" ).
|
326
|
+
expect( VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "dev" )).to be_truthy
|
327
327
|
end
|
328
328
|
it "does not fit stability" do
|
329
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "alpha" ).
|
329
|
+
expect( VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "alpha" )).to be_falsey
|
330
330
|
end
|
331
331
|
it "does not fit stability" do
|
332
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "RC" ).
|
332
|
+
expect( VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "RC" )).to be_falsey
|
333
333
|
end
|
334
334
|
it "does fit stability" do
|
335
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-RC", "RC" ).
|
335
|
+
expect( VersionTagRecognizer.does_it_fit_stability?( "2.2.1-RC", "RC" )).to be_truthy
|
336
336
|
end
|
337
337
|
|
338
338
|
|
339
339
|
|
340
340
|
it "stability_tag_for returns right" do
|
341
|
-
VersionTagRecognizer.stability_tag_for( "2.2.1").
|
341
|
+
expect( VersionTagRecognizer.stability_tag_for( "2.2.1")).to eql(VersionTagRecognizer::A_STABILITY_STABLE)
|
342
342
|
end
|
343
343
|
it "stability_tag_for returns right" do
|
344
|
-
VersionTagRecognizer.stability_tag_for( "2.2.1-RC").
|
344
|
+
expect( VersionTagRecognizer.stability_tag_for( "2.2.1-RC")).to eql(VersionTagRecognizer::A_STABILITY_RC)
|
345
345
|
end
|
346
346
|
it "stability_tag_for returns right" do
|
347
|
-
VersionTagRecognizer.stability_tag_for( "2.2.1-BETA1").
|
347
|
+
expect( VersionTagRecognizer.stability_tag_for( "2.2.1-BETA1")).to eql(VersionTagRecognizer::A_STABILITY_BETA)
|
348
348
|
end
|
349
349
|
it "stability_tag_for returns right" do
|
350
|
-
VersionTagRecognizer.stability_tag_for( "2.2.1-alpha").
|
350
|
+
expect( VersionTagRecognizer.stability_tag_for( "2.2.1-alpha")).to eql(VersionTagRecognizer::A_STABILITY_ALPHA)
|
351
351
|
end
|
352
352
|
it "stability_tag_for returns right" do
|
353
|
-
VersionTagRecognizer.stability_tag_for( "2.2.x-dev").
|
353
|
+
expect( VersionTagRecognizer.stability_tag_for( "2.2.x-dev")).to eql(VersionTagRecognizer::A_STABILITY_DEV)
|
354
354
|
end
|
355
355
|
|
356
356
|
|
357
357
|
it "stability_tag_for returns false" do
|
358
|
-
VersionTagRecognizer.stability_tag_for( "dev-garbage-collection-configuration").
|
358
|
+
expect( VersionTagRecognizer.stability_tag_for( "dev-garbage-collection-configuration")).to eql(VersionTagRecognizer::A_STABILITY_DEV)
|
359
359
|
end
|
360
360
|
|
361
361
|
|
@@ -4,245 +4,301 @@ require "naturalsorter"
|
|
4
4
|
describe Versioncmp do
|
5
5
|
|
6
6
|
it "smaler" do
|
7
|
-
Versioncmp.compare("1.1", "1.2").
|
7
|
+
expect( Versioncmp.compare("1.1", "1.2")).to eql(-1)
|
8
8
|
end
|
9
9
|
|
10
10
|
it "smaler" do
|
11
|
-
Versioncmp.compare("1.1.5", "1.1.x-dev").
|
11
|
+
expect( Versioncmp.compare("1.1.5", "1.1.x-dev")).to eql(-1)
|
12
12
|
end
|
13
13
|
|
14
14
|
it "smaler" do
|
15
|
-
Versioncmp.compare("1.1.5", "1.1-dev").
|
15
|
+
expect( Versioncmp.compare("1.1.5", "1.1-dev")).to eql(-1)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "smaler" do
|
19
|
-
Versioncmp.compare("0.3", "0.7-groovy-2.0").
|
19
|
+
expect( Versioncmp.compare("0.3", "0.7-groovy-2.0")).to eql(-1)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "smaler" do
|
23
|
+
expect( Versioncmp.compare("0.6-groovy-1.8-rc1", "0.6-groovy-1.8")).to eql(-1)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "bigger" do
|
27
|
+
expect( Versioncmp.compare("0.6-groovy-1.7", "0.6-groovy-1.7-rc1")).to eql(1)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "bigger" do
|
31
|
+
expect( Versioncmp.compare("5.0.1", "5.0.1-BETA")).to eql(1)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "bigger" do
|
35
|
+
expect( Versioncmp.compare("5.0.1", "5.0.1-SNAPSHOT")).to eql(1)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "bigger" do
|
39
|
+
expect( Versioncmp.compare("5.0.1", "5.0.1-beta")).to eql(1)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "bigger" do
|
43
|
+
expect( Versioncmp.compare("5.0.1", "5.0.1-alpha")).to eql(1)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "bigger" do
|
47
|
+
expect( Versioncmp.compare("5.0.1", "5.0.1-RC1")).to eql(1)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "bigger" do
|
51
|
+
expect( Versioncmp.compare("5.0.1", "5.0.1-RC-1")).to eql(1)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "bigger" do
|
55
|
+
expect( Versioncmp.compare("5.0.1", "5.0.1-alpha-1")).to eql(1)
|
56
|
+
end
|
57
|
+
|
58
|
+
it "bigger" do
|
59
|
+
expect( Versioncmp.compare("3.10-beta2", "3.9")).to eql(1)
|
60
|
+
end
|
61
|
+
|
62
|
+
it "bigger" do
|
63
|
+
expect( Versioncmp.compare("3.10-beta2", "3.10-beta1")).to eql(1)
|
64
|
+
end
|
65
|
+
|
66
|
+
it "bigger" do
|
67
|
+
expect( Versioncmp.compare("3.0.2-FINAL", "3.0.1-FINAL")).to eql(1)
|
68
|
+
end
|
69
|
+
|
70
|
+
it "bigger" do
|
71
|
+
expect( Versioncmp.compare("1.1", "1.0")).to eql(1)
|
72
|
+
end
|
73
|
+
|
74
|
+
it "bigger" do
|
75
|
+
expect( Versioncmp.compare("2.5", "2.0-beta-1")).to eql(1)
|
20
76
|
end
|
21
77
|
|
22
78
|
it "bigger" do
|
23
|
-
Versioncmp.compare("
|
79
|
+
expect( Versioncmp.compare("2.3", "2.0-beta-1")).to eql(1)
|
24
80
|
end
|
25
81
|
|
26
82
|
it "1.1.1 is bigger than 1.1" do
|
27
|
-
Versioncmp.compare("1.1.1", "1.1").
|
83
|
+
expect( Versioncmp.compare("1.1.1", "1.1")).to eql(1)
|
28
84
|
end
|
29
85
|
|
30
86
|
it "dev-master is bigger than 10.10.999" do
|
31
|
-
Versioncmp.compare("dev-master", "10.10.999").
|
87
|
+
expect( Versioncmp.compare("dev-master", "10.10.999")).to eql(1)
|
32
88
|
end
|
33
89
|
|
34
90
|
it "2.2.x-dev is bigger than 2.2.1" do
|
35
|
-
Versioncmp.compare("2.2.x-dev", "2.2.1").
|
91
|
+
expect( Versioncmp.compare("2.2.x-dev", "2.2.1")).to eql(1)
|
36
92
|
end
|
37
93
|
|
38
94
|
it "3.5.5-1 is bigger than 3.5.5" do
|
39
|
-
Versioncmp.compare("3.5.5-1", "3.5.5").
|
95
|
+
expect( Versioncmp.compare("3.5.5-1", "3.5.5")).to eql(1)
|
40
96
|
end
|
41
97
|
|
42
98
|
it "3.5.5 is smaller than 3.5.5-1 " do
|
43
|
-
Versioncmp.compare("3.5.5", "3.5.5-1").
|
99
|
+
expect( Versioncmp.compare("3.5.5", "3.5.5-1")).to eql(-1)
|
44
100
|
end
|
45
101
|
|
46
102
|
it "2.3.1-b01 is bigger than 2.3.1" do
|
47
|
-
Versioncmp.compare("2.3.1-b01", "2.3.1").
|
103
|
+
expect( Versioncmp.compare("2.3.1-b01", "2.3.1")).to eql(1)
|
48
104
|
end
|
49
105
|
|
50
106
|
it "2.3.2-b01 is bigger than 2.3.1" do
|
51
|
-
Versioncmp.compare("2.3.2-b01", "2.3.1").
|
107
|
+
expect( Versioncmp.compare("2.3.2-b01", "2.3.1")).to eql(1)
|
52
108
|
end
|
53
109
|
|
54
110
|
it "2.3.d-b01 is smaller than 2.3.1" do
|
55
|
-
Versioncmp.compare("2.3.d-b01", "2.3.1").
|
111
|
+
expect( Versioncmp.compare("2.3.d-b01", "2.3.1")).to eql(-1)
|
56
112
|
end
|
57
113
|
|
58
114
|
|
59
115
|
it "2.18.1 is bigger than 2.18-20141019" do
|
60
|
-
Versioncmp.compare("2.18.1", "2.18-20141019").
|
116
|
+
expect( Versioncmp.compare("2.18.1", "2.18-20141019")).to eql(1)
|
61
117
|
end
|
62
118
|
|
63
119
|
it "2.18-20141019 is smaller than 2.18.1" do
|
64
|
-
Versioncmp.compare("2.18-20141019", "2.18.1").
|
120
|
+
expect( Versioncmp.compare("2.18-20141019", "2.18.1")).to eql(-1)
|
65
121
|
end
|
66
122
|
|
67
123
|
|
68
124
|
it "1.1 is smaller than 1.1.1" do
|
69
|
-
Versioncmp.compare("1.1", "1.1.1").
|
125
|
+
expect( Versioncmp.compare("1.1", "1.1.1")).to eql(-1)
|
70
126
|
end
|
71
127
|
|
72
128
|
it "equal" do
|
73
|
-
Versioncmp.compare("1.1", "1.1").
|
129
|
+
expect( Versioncmp.compare("1.1", "1.1")).to eql(0)
|
74
130
|
end
|
75
131
|
|
76
132
|
it "equal" do
|
77
|
-
Versioncmp.compare("1.0", "1.0.0").
|
133
|
+
expect( Versioncmp.compare("1.0", "1.0.0")).to eql(0)
|
78
134
|
end
|
79
135
|
|
80
136
|
it "1.0.0 is smaller than 1.0.*" do
|
81
|
-
Versioncmp.compare("1.0.0", "1.0.*").
|
137
|
+
expect( Versioncmp.compare("1.0.0", "1.0.*")).to eql(-1)
|
82
138
|
end
|
83
139
|
|
84
140
|
it "1.0 is smaller than 1.0.*" do
|
85
|
-
Versioncmp.compare("1.0.0", "1.0.*").
|
141
|
+
expect( Versioncmp.compare("1.0.0", "1.0.*")).to eql(-1)
|
86
142
|
end
|
87
143
|
|
88
144
|
it "equal RC" do
|
89
|
-
Versioncmp.compare("1.1.RC1", "1.1.RC1").
|
145
|
+
expect( Versioncmp.compare("1.1.RC1", "1.1.RC1")).to eql(0)
|
90
146
|
end
|
91
147
|
|
92
148
|
it "smaller RC" do
|
93
|
-
Versioncmp.compare("1.1.RC1", "1.1").
|
149
|
+
expect( Versioncmp.compare("1.1.RC1", "1.1")).to eql(-1)
|
94
150
|
end
|
95
151
|
|
96
152
|
it "smaller RC" do
|
97
|
-
Versioncmp.compare("1.1.rc1", "1.1").
|
153
|
+
expect( Versioncmp.compare("1.1.rc1", "1.1")).to eql(-1)
|
98
154
|
end
|
99
155
|
|
100
156
|
it "smaller RC" do
|
101
|
-
Versioncmp.compare("1.1.rc1", "2.0").
|
157
|
+
expect( Versioncmp.compare("1.1.rc1", "2.0")).to eql(-1)
|
102
158
|
end
|
103
159
|
|
104
160
|
it "smaller RC" do
|
105
|
-
Versioncmp.compare("1.1-rc1", "1.1").
|
161
|
+
expect( Versioncmp.compare("1.1-rc1", "1.1")).to eql(-1)
|
106
162
|
end
|
107
163
|
|
108
164
|
it "smaller alpha" do
|
109
|
-
Versioncmp.compare("1.1-alpha1", "1.1").
|
165
|
+
expect( Versioncmp.compare("1.1-alpha1", "1.1")).to eql(-1)
|
110
166
|
end
|
111
167
|
|
112
168
|
it "alpha is smaller than BETA" do
|
113
|
-
Versioncmp.compare("2.1.0alpha", "2.1.0-BETA1").
|
169
|
+
expect( Versioncmp.compare("2.1.0alpha", "2.1.0-BETA1")).to eql(-1)
|
114
170
|
end
|
115
171
|
|
116
172
|
it "smaller alpha-1" do
|
117
|
-
Versioncmp.compare("1.1-alpha-1", "1.1").
|
173
|
+
expect( Versioncmp.compare("1.1-alpha-1", "1.1")).to eql(-1)
|
118
174
|
end
|
119
175
|
|
120
176
|
it "smaller alpha" do
|
121
|
-
Versioncmp.compare("1.1", "1.1-alpha-1").
|
177
|
+
expect( Versioncmp.compare("1.1", "1.1-alpha-1")).to eql(1)
|
122
178
|
end
|
123
179
|
|
124
180
|
it "smaller beta" do
|
125
|
-
Versioncmp.compare("3.1-beta1", "3.1").
|
181
|
+
expect( Versioncmp.compare("3.1-beta1", "3.1")).to eql(-1)
|
126
182
|
end
|
127
183
|
|
128
184
|
it "smaller beta" do
|
129
|
-
Versioncmp.compare("3.1-beta-1", "3.1").
|
185
|
+
expect( Versioncmp.compare("3.1-beta-1", "3.1")).to eql(-1)
|
130
186
|
end
|
131
187
|
|
132
188
|
it "smaller 3.0-rc4-negotiate" do
|
133
|
-
Versioncmp.compare("3.0-rc4-negotiate", "3.0").
|
189
|
+
expect( Versioncmp.compare("3.0-rc4-negotiate", "3.0")).to eql(-1)
|
134
190
|
end
|
135
191
|
|
136
192
|
it "smaller 3.1-jbossorg-1" do
|
137
|
-
Versioncmp.compare("3.1-jbossorg-1", "3.1").
|
193
|
+
expect( Versioncmp.compare("3.1-jbossorg-1", "3.1")).to eql(-1)
|
138
194
|
end
|
139
195
|
|
140
196
|
it "smaller 3.1-pre1" do
|
141
|
-
Versioncmp.compare("3.1-pre1", "3.1").
|
197
|
+
expect( Versioncmp.compare("3.1-pre1", "3.1")).to eql(-1)
|
142
198
|
end
|
143
199
|
|
144
200
|
it "bigger RC" do
|
145
|
-
Versioncmp.compare("1.1.rc3", "1.1.rc2").
|
201
|
+
expect( Versioncmp.compare("1.1.rc3", "1.1.rc2")).to eql(1)
|
146
202
|
end
|
147
203
|
|
148
204
|
it "bigger RC than 1.0" do
|
149
|
-
Versioncmp.compare("1.1.RC1", "1.0").
|
205
|
+
expect( Versioncmp.compare("1.1.RC1", "1.0")).to eql(1)
|
150
206
|
end
|
151
207
|
|
152
208
|
it "bigger RC than 1.0" do
|
153
|
-
Versioncmp.compare("1.1.RC1", "1.1").
|
209
|
+
expect( Versioncmp.compare("1.1.RC1", "1.1")).to eql(-1)
|
154
210
|
end
|
155
211
|
|
156
212
|
it "20040121.140929 is smaller than 1.1" do
|
157
|
-
Versioncmp.compare("20040121.140929", "1.1").
|
213
|
+
expect( Versioncmp.compare("20040121.140929", "1.1")).to eql(-1)
|
158
214
|
end
|
159
215
|
|
160
216
|
it "1.1 is bigger than 20040121.140929" do
|
161
|
-
Versioncmp.compare("1.1", "20040121.140929").
|
217
|
+
expect( Versioncmp.compare("1.1", "20040121.140929")).to eql(1)
|
162
218
|
end
|
163
219
|
|
164
220
|
it "1.7b2 is smaller than 1.7" do
|
165
|
-
Versioncmp.compare("1.7b2", "1.7").
|
221
|
+
expect( Versioncmp.compare("1.7b2", "1.7")).to eql(-1)
|
166
222
|
end
|
167
223
|
|
168
224
|
it "1.7 is bigger than 1.7b2" do
|
169
|
-
Versioncmp.compare("1.7", "1.7b2").
|
225
|
+
expect( Versioncmp.compare("1.7", "1.7b2")).to eql(1)
|
170
226
|
end
|
171
227
|
|
172
228
|
it "1.7 is bigger than 1.7rc2" do
|
173
|
-
Versioncmp.compare("1.7", "1.7rc2").
|
229
|
+
expect( Versioncmp.compare("1.7", "1.7rc2")).to eql(1)
|
174
230
|
end
|
175
231
|
|
176
232
|
it "1.7 is bigger than 1.7RC2" do
|
177
|
-
Versioncmp.compare("1.7", "1.7RC2").
|
233
|
+
expect( Versioncmp.compare("1.7", "1.7RC2")).to eql(1)
|
178
234
|
end
|
179
235
|
|
180
236
|
it "1.7 is bigger than 1.7a" do
|
181
|
-
Versioncmp.compare("1.7", "1.7a").
|
237
|
+
expect( Versioncmp.compare("1.7", "1.7a")).to eql(1)
|
182
238
|
end
|
183
239
|
|
184
240
|
it "1.7 is bigger than 1.7b" do
|
185
|
-
Versioncmp.compare("1.7", "1.7b").
|
241
|
+
expect( Versioncmp.compare("1.7", "1.7b")).to eql(1)
|
186
242
|
end
|
187
243
|
|
188
244
|
it "1.7b is bigger than 1.7a" do
|
189
|
-
Versioncmp.compare("1.7b", "1.7a").
|
245
|
+
expect( Versioncmp.compare("1.7b", "1.7a")).to eql(1)
|
190
246
|
end
|
191
247
|
|
192
248
|
it "1.7.1rc1 is smaller than 1.7.2" do
|
193
|
-
Versioncmp.compare("1.7.1rc1", "1.7.2").
|
249
|
+
expect( Versioncmp.compare("1.7.1rc1", "1.7.2")).to eql(-1)
|
194
250
|
end
|
195
251
|
|
196
252
|
it "1.7.2 is bigger than 1.7.1rc1" do
|
197
|
-
Versioncmp.compare("1.7.2", "1.7.1rc1").
|
253
|
+
expect( Versioncmp.compare("1.7.2", "1.7.1rc1")).to eql(1)
|
198
254
|
end
|
199
255
|
|
200
256
|
it "99.0-does-not-exist is smaller than 1.7.1" do
|
201
|
-
Versioncmp.compare("99.0-does-not-exist", "1.7.1").
|
257
|
+
expect( Versioncmp.compare("99.0-does-not-exist", "1.7.1")).to eql(-1)
|
202
258
|
end
|
203
259
|
|
204
260
|
it "2.2.1-b03 is bigger then 2.2" do
|
205
|
-
Versioncmp.compare("2.2.1-b03", "2.2").
|
261
|
+
expect( Versioncmp.compare("2.2.1-b03", "2.2")).to eql(1)
|
206
262
|
end
|
207
263
|
|
208
264
|
it "3.0.0 is equal to 3.0" do
|
209
|
-
Versioncmp.compare("3.0.0", "3.0").
|
265
|
+
expect( Versioncmp.compare("3.0.0", "3.0")).to eql(0)
|
210
266
|
end
|
211
267
|
|
212
268
|
it "3.0 is equal to 3.0.0" do
|
213
|
-
Versioncmp.compare("3.0", "3.0.0").
|
269
|
+
expect( Versioncmp.compare("3.0", "3.0.0")).to eql(0)
|
214
270
|
end
|
215
271
|
|
216
272
|
it "3.1-SNAPSHOT is equal to 3.1-SNAPSHOT" do
|
217
|
-
Versioncmp.compare("3.1-SNAPSHOT", "3.1-SNAPSHOT").
|
273
|
+
expect( Versioncmp.compare("3.1-SNAPSHOT", "3.1-SNAPSHOT")).to eql(0)
|
218
274
|
end
|
219
275
|
|
220
276
|
it "3.1-SNAPSHOT is smaller than 3.2-SNAPSHOT" do
|
221
|
-
Versioncmp.compare("3.1-SNAPSHOT", "3.2-SNAPSHOT").
|
277
|
+
expect( Versioncmp.compare("3.1-SNAPSHOT", "3.2-SNAPSHOT")).to eql(-1)
|
222
278
|
end
|
223
279
|
|
224
280
|
it "3.1 is smaller than 3.2-SNAPSHOT" do
|
225
|
-
Versioncmp.compare("3.1", "3.2-SNAPSHOT").
|
281
|
+
expect( Versioncmp.compare("3.1", "3.2-SNAPSHOT")).to eql(-1)
|
226
282
|
end
|
227
283
|
|
228
284
|
it "1.5.2 is smaller than 1.5.2-patch1" do
|
229
|
-
Versioncmp.compare("1.5.2", "1.5.2-patch1").
|
285
|
+
expect( Versioncmp.compare("1.5.2", "1.5.2-patch1")).to eql(-1)
|
230
286
|
end
|
231
287
|
|
232
288
|
it "dev-master is bigger than 1.0.0" do
|
233
|
-
Versioncmp.compare("dev-master", "1.0.0").
|
289
|
+
expect( Versioncmp.compare("dev-master", "1.0.0")).to eql(1)
|
234
290
|
end
|
235
291
|
|
236
292
|
it "dev-master is bigger than dev-support_old" do
|
237
|
-
Versioncmp.compare("dev-master", "dev-support_old").
|
293
|
+
expect( Versioncmp.compare("dev-master", "dev-support_old")).to eql(1)
|
238
294
|
end
|
239
295
|
|
240
296
|
it "dev-develop is bigger than 1.0.0" do
|
241
|
-
Versioncmp.compare("dev-develop", "1.0.0").
|
297
|
+
expect( Versioncmp.compare("dev-develop", "1.0.0")).to eql(1)
|
242
298
|
end
|
243
299
|
|
244
300
|
it "dev-something is bigger than 1.0.0" do
|
245
|
-
Versioncmp.compare("dev-something", "1.0.0").
|
301
|
+
expect( Versioncmp.compare("dev-something", "1.0.0")).to eql(1)
|
246
302
|
end
|
247
303
|
|
248
304
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: naturalsorter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- reiz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|