vim-flavor 1.1.5 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/features/.nav +6 -0
  4. data/features/branches/README.md +12 -0
  5. data/features/branches/changing_tracking_branches.feature +78 -0
  6. data/features/branches/detect_incompatible_declarations.feature +72 -0
  7. data/features/branches/install.feature +51 -0
  8. data/features/branches/upgrade.feature +30 -0
  9. data/features/install_vim_flavor.md +1 -1
  10. data/features/news.md +10 -0
  11. data/features/philosophy.md +22 -1
  12. data/features/resolve_dependencies/basics.feature +0 -32
  13. data/features/step_definitions/flavor_steps.rb +10 -0
  14. data/features/support/env.rb +7 -1
  15. data/features/version_lock.feature +1 -20
  16. data/features/version_tag_format.feature +44 -8
  17. data/lib/vim-flavor.rb +2 -0
  18. data/lib/vim-flavor/branchversion.rb +28 -0
  19. data/lib/vim-flavor/facade.rb +7 -3
  20. data/lib/vim-flavor/flavor.rb +20 -5
  21. data/lib/vim-flavor/flavorfile.rb +13 -12
  22. data/lib/vim-flavor/lockfileparser.rb +18 -4
  23. data/lib/vim-flavor/plainversion.rb +28 -0
  24. data/lib/vim-flavor/version.rb +10 -17
  25. data/lib/vim-flavor/versionconstraint.rb +23 -7
  26. data/spec/branchversion_spec.rb +50 -0
  27. data/spec/enumerableextension_spec.rb +4 -4
  28. data/spec/facade_spec.rb +2 -2
  29. data/spec/flavor_spec.rb +9 -8
  30. data/spec/flavorfile_spec.rb +44 -25
  31. data/spec/lockfile_spec.rb +58 -23
  32. data/spec/plainversion_spec.rb +75 -0
  33. data/spec/spec_helper.rb +10 -0
  34. data/spec/stringextension_spec.rb +4 -3
  35. data/spec/version_spec.rb +33 -51
  36. data/spec/versionconstraint_spec.rb +81 -26
  37. data/vim-flavor.gemspec +1 -0
  38. metadata +35 -3
@@ -3,52 +3,107 @@ require 'spec_helper'
3
3
  module Vim
4
4
  module Flavor
5
5
  describe VersionConstraint do
6
+ def v(s)
7
+ Version.create(s)
8
+ end
9
+
10
+ describe '.parse' do
11
+ def p(*args)
12
+ described_class.parse(*args)
13
+ end
14
+
15
+ it 'accepts ">= $version"' do
16
+ expect(p('>= 1.2.3')).to be == [v('1.2.3'), '>=']
17
+ end
18
+
19
+ it 'accepts "~> $version"' do
20
+ expect(p('~> 1.2.3')).to be == [v('1.2.3'), '~>']
21
+ end
22
+
23
+ it 'accepts "branch: $branch"' do
24
+ expect(p('branch: master')).to be == [v(branch: 'master'), 'branch:']
25
+ end
26
+
27
+ it 'ignores extra spaces' do
28
+ expect(p(' ~> 1.2.3 ')).to be == p('~> 1.2.3')
29
+ end
30
+
31
+ it 'fails with an unknown qualifier' do
32
+ expect {
33
+ p('!? 1.2.3')
34
+ }.to raise_error('Invalid version constraint: "!? 1.2.3"')
35
+ end
36
+
37
+ it 'fails with an invalid format' do
38
+ expect {
39
+ p('1.2.3')
40
+ }.to raise_error('Invalid version constraint: "1.2.3"')
41
+
42
+ expect {
43
+ p('>= 2.0 beta')
44
+ }.to raise_error('Invalid version constraint: ">= 2.0 beta"')
45
+ end
46
+ end
47
+
6
48
  describe '#compatible?' do
7
- describe '>=' do
49
+ context 'with ">= 1.2.3"' do
8
50
  subject {VersionConstraint.new('>= 1.2.3')}
9
51
 
10
- it {should be_compatible '1.2.3'}
52
+ it {is_expected.to be_compatible v('1.2.3')}
11
53
 
12
- it {should be_compatible '1.2.4'}
13
- it {should be_compatible '1.3.3'}
14
- it {should be_compatible '2.2.3'}
54
+ it {is_expected.to be_compatible v('1.2.4')}
55
+ it {is_expected.to be_compatible v('1.3.3')}
56
+ it {is_expected.to be_compatible v('2.2.3')}
15
57
 
16
- it {should be_compatible '1.3'}
58
+ it {is_expected.to be_compatible v('1.3')}
17
59
 
18
- it {should_not be_compatible '1.2.2'}
19
- it {should_not be_compatible '1.1.3'}
20
- it {should_not be_compatible '0.2.3'}
60
+ it {is_expected.not_to be_compatible v('1.2.2')}
61
+ it {is_expected.not_to be_compatible v('1.1.3')}
62
+ it {is_expected.not_to be_compatible v('0.2.3')}
21
63
 
22
- it {should_not be_compatible '1.2'}
64
+ it {is_expected.not_to be_compatible v('1.2')}
23
65
  end
24
66
 
25
- describe '~>' do
67
+ context 'with "~> 1.2.3"' do
26
68
  subject {VersionConstraint.new('~> 1.2.3')}
27
69
 
28
- it {should be_compatible '1.2.3'}
70
+ it {is_expected.to be_compatible v('1.2.3')}
71
+
72
+ it {is_expected.to be_compatible v('1.2.4')}
73
+ it {is_expected.not_to be_compatible v('1.3.3')}
74
+ it {is_expected.not_to be_compatible v('2.2.3')}
75
+
76
+ it {is_expected.not_to be_compatible v('1.3')}
29
77
 
30
- it {should be_compatible '1.2.4'}
31
- it {should_not be_compatible '1.3.3'}
32
- it {should_not be_compatible '2.2.3'}
78
+ it {is_expected.not_to be_compatible v('1.2.2')}
79
+ it {is_expected.not_to be_compatible v('1.1.3')}
80
+ it {is_expected.not_to be_compatible v('0.2.3')}
33
81
 
34
- it {should_not be_compatible '1.3'}
82
+ it {is_expected.not_to be_compatible v('1.2')}
83
+ end
84
+
85
+ context 'with "branch: master"' do
86
+ subject {VersionConstraint.new('branch: master')}
35
87
 
36
- it {should_not be_compatible '1.2.2'}
37
- it {should_not be_compatible '1.1.3'}
38
- it {should_not be_compatible '0.2.3'}
88
+ it {is_expected.to be_compatible v(branch: 'master')}
89
+ it {is_expected.to be_compatible v(branch: 'master', revision: '1' * 40)}
90
+ it {is_expected.to be_compatible v(branch: 'master', revision: '2' * 40)}
39
91
 
40
- it {should_not be_compatible '1.2'}
92
+ it {is_expected.not_to be_compatible v(branch: 'experimental')}
41
93
  end
42
94
  end
43
95
 
44
96
  describe '#find_the_best_version' do
45
97
  it 'returns the best version from given versions' do
46
- VersionConstraint.new('>= 1.2.3').
47
- find_the_best_version(['1.2.2', '1.2.3', '1.2.4', '1.3.3', '2.0']).
48
- should == '2.0'
49
- VersionConstraint.new('~> 1.2.3').
50
- find_the_best_version(['1.2.2', '1.2.3', '1.2.4', '1.3.3', '2.0']).
51
- should == '1.2.4'
98
+ versions = ['1.2.2', '1.2.3', '1.2.4', '1.3.3', '2.0'].map {|s| v(s)}
99
+ expect(
100
+ VersionConstraint.new('>= 1.2.3').
101
+ find_the_best_version(versions)
102
+ ).to be == v('2.0')
103
+ expect(
104
+ VersionConstraint.new('~> 1.2.3').
105
+ find_the_best_version(versions)
106
+ ).to be == v('1.2.4')
52
107
  end
53
108
 
54
109
  it 'fails if no version is given' do
data/vim-flavor.gemspec CHANGED
@@ -20,5 +20,6 @@ Gem::Specification.new do |gem|
20
20
 
21
21
  gem.add_development_dependency('aruba', '~> 0.5')
22
22
  gem.add_development_dependency('cucumber', '~> 1.2')
23
+ gem.add_development_dependency('pry')
23
24
  gem.add_development_dependency('rspec', '~> 2.8')
24
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vim-flavor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kana Natsuno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-21 00:00:00.000000000 Z
11
+ date: 2014-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rspec
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -99,6 +113,11 @@ files:
99
113
  - bin/vim-flavor
100
114
  - features/.nav
101
115
  - features/README.md
116
+ - features/branches/README.md
117
+ - features/branches/changing_tracking_branches.feature
118
+ - features/branches/detect_incompatible_declarations.feature
119
+ - features/branches/install.feature
120
+ - features/branches/upgrade.feature
102
121
  - features/caching/README.md
103
122
  - features/caching/basics.feature
104
123
  - features/caching/deployment.feature
@@ -112,6 +131,7 @@ files:
112
131
  - features/flavorfile/repository_name.feature
113
132
  - features/flavorfile/version_constraint.feature
114
133
  - features/install_vim_flavor.md
134
+ - features/news.md
115
135
  - features/philosophy.md
116
136
  - features/resolve_dependencies/README.md
117
137
  - features/resolve_dependencies/basics.feature
@@ -140,6 +160,7 @@ files:
140
160
  - features/version_lock.feature
141
161
  - features/version_tag_format.feature
142
162
  - lib/vim-flavor.rb
163
+ - lib/vim-flavor/branchversion.rb
143
164
  - lib/vim-flavor/cli.rb
144
165
  - lib/vim-flavor/enumerableextension.rb
145
166
  - lib/vim-flavor/env.rb
@@ -148,15 +169,18 @@ files:
148
169
  - lib/vim-flavor/flavorfile.rb
149
170
  - lib/vim-flavor/lockfile.rb
150
171
  - lib/vim-flavor/lockfileparser.rb
172
+ - lib/vim-flavor/plainversion.rb
151
173
  - lib/vim-flavor/shellutility.rb
152
174
  - lib/vim-flavor/stringextension.rb
153
175
  - lib/vim-flavor/version.rb
154
176
  - lib/vim-flavor/versionconstraint.rb
177
+ - spec/branchversion_spec.rb
155
178
  - spec/enumerableextension_spec.rb
156
179
  - spec/facade_spec.rb
157
180
  - spec/flavor_spec.rb
158
181
  - spec/flavorfile_spec.rb
159
182
  - spec/lockfile_spec.rb
183
+ - spec/plainversion_spec.rb
160
184
  - spec/spec_helper.rb
161
185
  - spec/stringextension_spec.rb
162
186
  - spec/version_spec.rb
@@ -181,12 +205,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
205
  version: '0'
182
206
  requirements: []
183
207
  rubyforge_project:
184
- rubygems_version: 2.2.1
208
+ rubygems_version: 2.2.2
185
209
  signing_key:
186
210
  specification_version: 4
187
211
  summary: A tool to manage your favorite Vim plugins
188
212
  test_files:
189
213
  - features/README.md
214
+ - features/branches/README.md
215
+ - features/branches/changing_tracking_branches.feature
216
+ - features/branches/detect_incompatible_declarations.feature
217
+ - features/branches/install.feature
218
+ - features/branches/upgrade.feature
190
219
  - features/caching/README.md
191
220
  - features/caching/basics.feature
192
221
  - features/caching/deployment.feature
@@ -200,6 +229,7 @@ test_files:
200
229
  - features/flavorfile/repository_name.feature
201
230
  - features/flavorfile/version_constraint.feature
202
231
  - features/install_vim_flavor.md
232
+ - features/news.md
203
233
  - features/philosophy.md
204
234
  - features/resolve_dependencies/README.md
205
235
  - features/resolve_dependencies/basics.feature
@@ -227,11 +257,13 @@ test_files:
227
257
  - features/uninstall_vim_flavor.md
228
258
  - features/version_lock.feature
229
259
  - features/version_tag_format.feature
260
+ - spec/branchversion_spec.rb
230
261
  - spec/enumerableextension_spec.rb
231
262
  - spec/facade_spec.rb
232
263
  - spec/flavor_spec.rb
233
264
  - spec/flavorfile_spec.rb
234
265
  - spec/lockfile_spec.rb
266
+ - spec/plainversion_spec.rb
235
267
  - spec/spec_helper.rb
236
268
  - spec/stringextension_spec.rb
237
269
  - spec/version_spec.rb