berkshelf 3.0.0.beta1 → 3.0.0.beta2
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.
- checksums.yaml +7 -0
- data/.ruby-version +1 -1
- data/CONTRIBUTING.md +2 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/Thorfile +2 -2
- data/berkshelf.gemspec +3 -3
- data/features/install_command.feature +36 -8
- data/features/json_formatter.feature +93 -3
- data/features/licenses.feature +1 -1
- data/features/lockfile.feature +0 -12
- data/features/outdated_command.feature +124 -0
- data/features/show_command.feature +44 -25
- data/features/step_definitions/chef/config_steps.rb +2 -2
- data/features/step_definitions/chef_server_steps.rb +9 -1
- data/features/step_definitions/config_steps.rb +1 -1
- data/features/step_definitions/filesystem_steps.rb +7 -0
- data/features/support/env.rb +2 -1
- data/features/update_command.feature +11 -21
- data/features/upload_command.feature +45 -1
- data/features/vendor_command.feature +83 -0
- data/lib/berkshelf.rb +5 -4
- data/lib/berkshelf/api_client/remote_cookbook.rb +13 -0
- data/lib/berkshelf/berksfile.rb +155 -23
- data/lib/berkshelf/chef.rb +0 -1
- data/lib/berkshelf/cli.rb +40 -31
- data/lib/berkshelf/dependency.rb +14 -4
- data/lib/berkshelf/errors.rb +74 -3
- data/lib/berkshelf/formatters.rb +12 -1
- data/lib/berkshelf/formatters/human_readable.rb +44 -5
- data/lib/berkshelf/formatters/json.rb +50 -8
- data/lib/berkshelf/installer.rb +8 -8
- data/lib/berkshelf/location.rb +17 -0
- data/lib/berkshelf/locations/git_location.rb +7 -17
- data/lib/berkshelf/locations/mercurial_location.rb +112 -0
- data/lib/berkshelf/lockfile.rb +1 -1
- data/lib/berkshelf/mercurial.rb +146 -0
- data/lib/berkshelf/version.rb +1 -1
- data/spec/config/knife.rb +2 -4
- data/spec/fixtures/lockfiles/default.lock +0 -1
- data/spec/support/chef_api.rb +9 -2
- data/spec/support/mercurial.rb +122 -0
- data/spec/support/path_helpers.rb +2 -2
- data/spec/unit/berkshelf/berksfile_spec.rb +34 -8
- data/spec/unit/berkshelf/dependency_spec.rb +0 -7
- data/spec/unit/berkshelf/formatters/null_spec.rb +1 -1
- data/spec/unit/berkshelf/locations/mercurial_location_spec.rb +150 -0
- data/spec/unit/berkshelf/lockfile_spec.rb +0 -12
- data/spec/unit/berkshelf/mercurial_spec.rb +173 -0
- metadata +32 -110
- data/lib/berkshelf/chef/config.rb +0 -68
- data/lib/berkshelf/mixin/config.rb +0 -172
- data/spec/fixtures/cookbooks/example_metadata_name/metadata.rb +0 -2
- data/spec/fixtures/cookbooks/example_metadata_no_name/metadata.rb +0 -1
- data/spec/fixtures/cookbooks/example_no_metadata/recipes/default.rb +0 -1
- data/spec/fixtures/cookbooks/nginx-0.100.5/README.md +0 -77
- data/spec/fixtures/cookbooks/nginx-0.100.5/attributes/default.rb +0 -65
- data/spec/fixtures/cookbooks/nginx-0.100.5/definitions/nginx_site.rb +0 -35
- data/spec/fixtures/cookbooks/nginx-0.100.5/files/default/mime.types +0 -73
- data/spec/fixtures/cookbooks/nginx-0.100.5/files/ubuntu/mime.types +0 -73
- data/spec/fixtures/cookbooks/nginx-0.100.5/libraries/nginxlib.rb +0 -1
- data/spec/fixtures/cookbooks/nginx-0.100.5/metadata.rb +0 -91
- data/spec/fixtures/cookbooks/nginx-0.100.5/providers/defprovider.rb +0 -1
- data/spec/fixtures/cookbooks/nginx-0.100.5/recipes/default.rb +0 -59
- data/spec/fixtures/cookbooks/nginx-0.100.5/resources/defresource.rb +0 -1
- data/spec/fixtures/cookbooks/nginx-0.100.5/templates/default/nginx.pill.erb +0 -15
- data/spec/fixtures/cookbooks/nginx-0.100.5/templates/default/plugins/nginx.rb.erb +0 -66
- data/spec/fixtures/lockfile_spec/with_lock/Berksfile +0 -1
- data/spec/fixtures/lockfile_spec/without_lock/.gitkeep +0 -0
- data/spec/fixtures/reset.pem +0 -27
- data/spec/unit/chef/config_spec.rb +0 -81
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f9eeec61abc7afc5a3a61ba58852f1ee753969f3
|
4
|
+
data.tar.gz: bf73a4918c2c1c00873e586f5e2e2a38fc7f30a8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ff93338dfc827ddac156835b12deff45ac00d18515185cd2abad4f8283295987d28c31fc371d96ad045a0cc2392d22e3957e037fc00469c769e9b4b913c00480
|
7
|
+
data.tar.gz: 5d6fab4ced0612343c398a9b39893636e78bbee24f525160016c322c0e42e279cb86764004f98b59d57fe49c0f37432ad5de50ba8460b8fe55664f0dd0785f17
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0-p247
|
data/CONTRIBUTING.md
CHANGED
data/LICENSE
CHANGED
@@ -3,7 +3,7 @@ Copyright 2012-2013 Riot Games
|
|
3
3
|
Jamie Winsor (<jamie@vialstudios.com>)
|
4
4
|
Josiah Kiehl (<jkiehl@riotgames.com>)
|
5
5
|
Michael Ivey (<michael.ivey@riotgames.com>)
|
6
|
-
Justin Campbell (<justin
|
6
|
+
Justin Campbell (<justin@justincampbell.me>)
|
7
7
|
Seth Vargo (<sethvargo@gmail.com>)
|
8
8
|
|
9
9
|
Licensed under the Apache License, Version 2.0 (the "License");
|
data/README.md
CHANGED
@@ -86,7 +86,7 @@ Authors
|
|
86
86
|
- Jamie Winsor (<jamie@vialstudios.com>)
|
87
87
|
- Josiah Kiehl (<jkiehl@riotgames.com>)
|
88
88
|
- Michael Ivey (<michael.ivey@riotgames.com>)
|
89
|
-
- Justin Campbell (<justin
|
89
|
+
- Justin Campbell (<justin@justincampbell.me>)
|
90
90
|
- Seth Vargo (<sethvargo@gmail.com>)
|
91
91
|
|
92
92
|
Thank you to all of our [Contributors](https://github.com/RiotGames/berkshelf/graphs/contributors), testers, and users.
|
data/Thorfile
CHANGED
@@ -56,11 +56,11 @@ class Spec < Thor
|
|
56
56
|
|
57
57
|
no_tasks do
|
58
58
|
def units_command
|
59
|
-
run('rspec --color --format
|
59
|
+
run('rspec --color --format progress spec/unit')
|
60
60
|
end
|
61
61
|
|
62
62
|
def acceptance_command
|
63
|
-
run('cucumber --color --format
|
63
|
+
run('cucumber --color --format progress --tags ~@no_run')
|
64
64
|
end
|
65
65
|
|
66
66
|
def quality_command
|
data/berkshelf.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
'jamie@vialstudios.com',
|
14
14
|
'jkiehl@riotgames.com',
|
15
15
|
'michael.ivey@riotgames.com',
|
16
|
-
'justin
|
16
|
+
'justin@justincampbell.me',
|
17
17
|
'sethvargo@gmail.com'
|
18
18
|
]
|
19
19
|
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.required_rubygems_version = '>= 1.8.0'
|
32
32
|
|
33
33
|
s.add_dependency 'addressable', '~> 2.3.4'
|
34
|
-
s.add_dependency 'buff-config', '~> 0.
|
34
|
+
s.add_dependency 'buff-config', '~> 0.2'
|
35
35
|
s.add_dependency 'buff-extensions', '~> 0.4'
|
36
36
|
s.add_dependency 'buff-shell_out', '~> 0.1'
|
37
37
|
s.add_dependency 'celluloid', '>= 0.14.0'
|
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
s.add_dependency 'hashie', '>= 2.0.2'
|
40
40
|
s.add_dependency 'minitar', '~> 0.5.4'
|
41
41
|
s.add_dependency 'retryable', '~> 1.3.3'
|
42
|
-
s.add_dependency 'ridley', '~> 1.
|
42
|
+
s.add_dependency 'ridley', '~> 1.4.0'
|
43
43
|
s.add_dependency 'solve', '>= 0.5.0'
|
44
44
|
s.add_dependency 'thor', '~> 0.18.0'
|
45
45
|
|
@@ -18,7 +18,7 @@ Feature: install cookbooks from a Berksfile
|
|
18
18
|
And the Chef Server has cookbooks:
|
19
19
|
| berkshelf | 1.0.0 |
|
20
20
|
| berkshelf | 2.0.0 |
|
21
|
-
And the Berkshelf API server cache is up to date
|
21
|
+
And the Berkshelf API server's cache is up to date
|
22
22
|
When I successfully run `berks install`
|
23
23
|
Then the output should contain:
|
24
24
|
"""
|
@@ -37,7 +37,7 @@ Feature: install cookbooks from a Berksfile
|
|
37
37
|
And the Chef Server has cookbooks:
|
38
38
|
| berkshelf | 1.0.0 |
|
39
39
|
| berkshelf | 2.0.0 |
|
40
|
-
And the Berkshelf API server cache is up to date
|
40
|
+
And the Berkshelf API server's cache is up to date
|
41
41
|
When I successfully run `berks install`
|
42
42
|
Then the output should contain:
|
43
43
|
"""
|
@@ -62,7 +62,7 @@ Feature: install cookbooks from a Berksfile
|
|
62
62
|
And the Chef Server has cookbooks:
|
63
63
|
| ruby | 1.0.0 |
|
64
64
|
| elixir | 1.0.0 |
|
65
|
-
And the Berkshelf API server cache is up to date
|
65
|
+
And the Berkshelf API server's cache is up to date
|
66
66
|
When I successfully run `berks install`
|
67
67
|
Then the output should contain:
|
68
68
|
"""
|
@@ -84,7 +84,7 @@ Feature: install cookbooks from a Berksfile
|
|
84
84
|
| hostsfile | = 1.0.1 |
|
85
85
|
And the cookbook store has the cookbooks:
|
86
86
|
| hostsfile | 1.0.1 |
|
87
|
-
And the Berkshelf API server cache is up to date
|
87
|
+
And the Berkshelf API server's cache is up to date
|
88
88
|
When I successfully run `berks install`
|
89
89
|
Then the output should contain:
|
90
90
|
"""
|
@@ -96,9 +96,9 @@ Feature: install cookbooks from a Berksfile
|
|
96
96
|
"""
|
97
97
|
source "http://localhost:26210"
|
98
98
|
|
99
|
-
cookbook 'example_cookbook', path: '../../
|
99
|
+
cookbook 'example_cookbook', path: '../../fixtures/cookbooks/example_cookbook-0.5.0'
|
100
100
|
"""
|
101
|
-
And the Berkshelf API server cache is up to date
|
101
|
+
And the Berkshelf API server's cache is up to date
|
102
102
|
When I successfully run `berks install`
|
103
103
|
Then the output should contain:
|
104
104
|
"""
|
@@ -110,7 +110,7 @@ Feature: install cookbooks from a Berksfile
|
|
110
110
|
"""
|
111
111
|
source "http://localhost:26210"
|
112
112
|
|
113
|
-
cookbook 'example_cookbook', path: '../../../
|
113
|
+
cookbook 'example_cookbook', path: '../../../fixtures/cookbooks/example_cookbook-0.5.0'
|
114
114
|
"""
|
115
115
|
When I successfully run `berks install -b ./tmp_berks/Berksfile`
|
116
116
|
Then the output should contain:
|
@@ -266,11 +266,39 @@ Feature: install cookbooks from a Berksfile
|
|
266
266
|
Using fake (0.0.0)
|
267
267
|
"""
|
268
268
|
|
269
|
+
Scenario: running install when a Berksfile.lock is present
|
270
|
+
Given the Chef Server has cookbooks:
|
271
|
+
| bacon | 0.1.0 |
|
272
|
+
| bacon | 0.2.0 |
|
273
|
+
| bacon | 1.0.0 |
|
274
|
+
And the Berkshelf API server's cache is up to date
|
275
|
+
And I write to "Berksfile" with:
|
276
|
+
"""
|
277
|
+
source "http://localhost:26210"
|
278
|
+
|
279
|
+
cookbook 'bacon', '~> 0.1'
|
280
|
+
"""
|
281
|
+
And I write to "Berksfile.lock" with:
|
282
|
+
"""
|
283
|
+
{
|
284
|
+
"dependencies": {
|
285
|
+
"bacon": {
|
286
|
+
"locked_version": "0.2.0"
|
287
|
+
}
|
288
|
+
}
|
289
|
+
}
|
290
|
+
"""
|
291
|
+
When I successfully run `berks install`
|
292
|
+
Then the output should contain:
|
293
|
+
"""
|
294
|
+
Installing bacon (0.2.0)
|
295
|
+
"""
|
296
|
+
|
269
297
|
Scenario: running install with no Berksfile or Berksfile.lock
|
270
298
|
When I run `berks install`
|
271
299
|
Then the output should contain:
|
272
300
|
"""
|
273
|
-
No Berksfile or Berksfile.lock found at
|
301
|
+
No Berksfile or Berksfile.lock found at '
|
274
302
|
"""
|
275
303
|
And the exit status should be "BerksfileNotFound"
|
276
304
|
|
@@ -17,7 +17,7 @@ Feature: --format json
|
|
17
17
|
"""
|
18
18
|
And the Chef Server has cookbooks:
|
19
19
|
| berkshelf | 1.0.0 |
|
20
|
-
And the Berkshelf API server cache is up to date
|
20
|
+
And the Berkshelf API server's cache is up to date
|
21
21
|
When I successfully run `berks install --format json`
|
22
22
|
Then the output should contain JSON:
|
23
23
|
"""
|
@@ -65,12 +65,53 @@ Feature: --format json
|
|
65
65
|
}
|
66
66
|
"""
|
67
67
|
|
68
|
+
Scenario: JSON output when running the show command
|
69
|
+
Given the cookbook store has the cookbooks:
|
70
|
+
| fake | 1.0.0 |
|
71
|
+
And I write to "Berksfile" with:
|
72
|
+
"""
|
73
|
+
source "http://localhost:26210"
|
74
|
+
|
75
|
+
cookbook 'fake', '1.0.0'
|
76
|
+
"""
|
77
|
+
And I write to "Berksfile.lock" with:
|
78
|
+
"""
|
79
|
+
{
|
80
|
+
"dependencies": {
|
81
|
+
"fake": {
|
82
|
+
"locked_version": "1.0.0"
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
"""
|
87
|
+
When I successfully run `berks show fake --format json`
|
88
|
+
Then the output should contain JSON:
|
89
|
+
"""
|
90
|
+
{
|
91
|
+
"cookbooks": [
|
92
|
+
{
|
93
|
+
"name": "fake",
|
94
|
+
"version": "1.0.0",
|
95
|
+
"description": "A fabulous new cookbook",
|
96
|
+
"author": "YOUR_COMPANY_NAME",
|
97
|
+
"email": "YOUR_EMAIL",
|
98
|
+
"license": "none"
|
99
|
+
}
|
100
|
+
],
|
101
|
+
"errors": [
|
102
|
+
|
103
|
+
],
|
104
|
+
"messages": [
|
105
|
+
]
|
106
|
+
}
|
107
|
+
"""
|
108
|
+
|
68
109
|
Scenario: JSON output when running the upload command
|
69
110
|
Given I write to "Berksfile" with:
|
70
111
|
"""
|
71
112
|
source "http://localhost:26210"
|
72
113
|
|
73
|
-
cookbook 'example_cookbook', path: '../../
|
114
|
+
cookbook 'example_cookbook', path: '../../fixtures/cookbooks/example_cookbook-0.5.0'
|
74
115
|
"""
|
75
116
|
When I successfully run `berks upload --format json`
|
76
117
|
Then the output should contain JSON:
|
@@ -80,7 +121,7 @@ Feature: --format json
|
|
80
121
|
{
|
81
122
|
"name": "example_cookbook",
|
82
123
|
"version": "0.5.0",
|
83
|
-
"location": "../../
|
124
|
+
"location": "../../fixtures/cookbooks/example_cookbook-0.5.0",
|
84
125
|
"uploaded_to": "http://localhost:26310/"
|
85
126
|
}
|
86
127
|
],
|
@@ -92,3 +133,52 @@ Feature: --format json
|
|
92
133
|
]
|
93
134
|
}
|
94
135
|
"""
|
136
|
+
|
137
|
+
Scenario: JSON output when running the outdated command
|
138
|
+
Given the cookbook store has the cookbooks:
|
139
|
+
| seth | 0.1.0 |
|
140
|
+
And the Chef Server has cookbooks:
|
141
|
+
| seth | 0.1.0 |
|
142
|
+
| seth | 0.2.9 |
|
143
|
+
| seth | 1.0.0 |
|
144
|
+
And the Berkshelf API server's cache is up to date
|
145
|
+
And I write to "Berksfile" with:
|
146
|
+
"""
|
147
|
+
source "http://localhost:26210"
|
148
|
+
|
149
|
+
cookbook 'seth', '~> 0.1'
|
150
|
+
"""
|
151
|
+
And I write to "Berksfile.lock" with:
|
152
|
+
"""
|
153
|
+
{
|
154
|
+
"dependencies": {
|
155
|
+
"seth": {
|
156
|
+
"locked_version": "0.1.0"
|
157
|
+
}
|
158
|
+
}
|
159
|
+
}
|
160
|
+
"""
|
161
|
+
And I successfully run `berks outdated --format json`
|
162
|
+
Then the output should contain:
|
163
|
+
"""
|
164
|
+
{
|
165
|
+
"cookbooks": [
|
166
|
+
{
|
167
|
+
"version": "0.2.9",
|
168
|
+
"sources": {
|
169
|
+
"http://localhost:26210": {
|
170
|
+
"name": "seth",
|
171
|
+
"version": "0.2.9"
|
172
|
+
}
|
173
|
+
},
|
174
|
+
"name": "seth"
|
175
|
+
}
|
176
|
+
],
|
177
|
+
"errors": [
|
178
|
+
|
179
|
+
],
|
180
|
+
"messages": [
|
181
|
+
"The following cookbooks have newer versions:"
|
182
|
+
]
|
183
|
+
}
|
184
|
+
"""
|
data/features/licenses.feature
CHANGED
@@ -102,7 +102,7 @@ Feature: Installing cookbooks with specific licenses
|
|
102
102
|
"""
|
103
103
|
source "http://localhost:26210"
|
104
104
|
|
105
|
-
cookbook 'fake', path: '../../
|
105
|
+
cookbook 'fake', path: '../../tmp/berkshelf/cookbooks/fake-0.1.0'
|
106
106
|
"""
|
107
107
|
And I have a Berkshelf config file containing:
|
108
108
|
"""
|
data/features/lockfile.feature
CHANGED
@@ -18,7 +18,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
18
18
|
{
|
19
19
|
"dependencies":{
|
20
20
|
"fake":{
|
21
|
-
"constraint":"= 1.0.0",
|
22
21
|
"locked_version":"1.0.0"
|
23
22
|
}
|
24
23
|
}
|
@@ -45,7 +44,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
45
44
|
{
|
46
45
|
"dependencies": {
|
47
46
|
"fake": {
|
48
|
-
"constraint": "= 1.0.0",
|
49
47
|
"locked_version": "1.0.0"
|
50
48
|
}
|
51
49
|
}
|
@@ -66,7 +64,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
66
64
|
{
|
67
65
|
"dependencies": {
|
68
66
|
"fake": {
|
69
|
-
"constraint": "= 1.0.0",
|
70
67
|
"locked_version": "1.0.0"
|
71
68
|
}
|
72
69
|
}
|
@@ -78,7 +75,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
78
75
|
{
|
79
76
|
"dependencies": {
|
80
77
|
"fake": {
|
81
|
-
"constraint": "= 1.0.0",
|
82
78
|
"locked_version": "1.0.0"
|
83
79
|
}
|
84
80
|
}
|
@@ -104,7 +100,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
104
100
|
{
|
105
101
|
"dependencies":{
|
106
102
|
"fake":{
|
107
|
-
"constraint":"= 0.0.0",
|
108
103
|
"path":"./fake"
|
109
104
|
}
|
110
105
|
}
|
@@ -159,7 +154,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
159
154
|
{
|
160
155
|
"dependencies": {
|
161
156
|
"fake":{
|
162
|
-
"constraint": "= 1.0.0",
|
163
157
|
"locked_version": "1.0.0"
|
164
158
|
},
|
165
159
|
"dep":{
|
@@ -183,7 +177,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
183
177
|
{
|
184
178
|
"dependencies":{
|
185
179
|
"berkshelf-cookbook-fixture":{
|
186
|
-
"constraint":"~> 1.0.0",
|
187
180
|
"locked_version":"1.0.0"
|
188
181
|
}
|
189
182
|
}
|
@@ -195,7 +188,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
195
188
|
{
|
196
189
|
"dependencies":{
|
197
190
|
"berkshelf-cookbook-fixture":{
|
198
|
-
"constraint":"~> 1.0.0",
|
199
191
|
"locked_version":"1.0.0"
|
200
192
|
}
|
201
193
|
}
|
@@ -217,7 +209,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
217
209
|
{
|
218
210
|
"dependencies":{
|
219
211
|
"berkshelf-cookbook-fixture":{
|
220
|
-
"constraint":"~> 0.1",
|
221
212
|
"locked_version":"0.1.0"
|
222
213
|
}
|
223
214
|
}
|
@@ -229,7 +220,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
229
220
|
{
|
230
221
|
"dependencies":{
|
231
222
|
"berkshelf-cookbook-fixture":{
|
232
|
-
"constraint":"~> 0.1",
|
233
223
|
"locked_version":"0.2.0"
|
234
224
|
}
|
235
225
|
}
|
@@ -250,7 +240,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
250
240
|
{
|
251
241
|
"dependencies":{
|
252
242
|
"berkshelf-cookbook-fixture":{
|
253
|
-
"constraint":"= 1.0.0",
|
254
243
|
"locked_version":"1.0.0"
|
255
244
|
}
|
256
245
|
}
|
@@ -262,7 +251,6 @@ Feature: Creating and reading the Berkshelf lockfile
|
|
262
251
|
{
|
263
252
|
"dependencies":{
|
264
253
|
"berkshelf-cookbook-fixture":{
|
265
|
-
"constraint":"= 1.0.0",
|
266
254
|
"locked_version":"1.0.0"
|
267
255
|
}
|
268
256
|
}
|
@@ -4,5 +4,129 @@ Feature: Displaying outdated cookbooks
|
|
4
4
|
So that I can decide whether to update everything at once
|
5
5
|
|
6
6
|
Scenario: the dependency is up to date
|
7
|
+
Given the Chef Server has cookbooks:
|
8
|
+
| bacon | 1.0.0 |
|
9
|
+
| bacon | 1.1.0 |
|
10
|
+
And the Berkshelf API server's cache is up to date
|
11
|
+
And the cookbook store has the cookbooks:
|
12
|
+
| bacon | 1.1.0 |
|
13
|
+
And I write to "Berksfile" with:
|
14
|
+
"""
|
15
|
+
source "http://localhost:26210"
|
16
|
+
|
17
|
+
cookbook 'bacon', '~> 1.1.0'
|
18
|
+
"""
|
19
|
+
And I write to "Berksfile.lock" with:
|
20
|
+
"""
|
21
|
+
{
|
22
|
+
"dependencies": {
|
23
|
+
"bacon": {
|
24
|
+
"locked_version": "1.1.0"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
"""
|
29
|
+
When I successfully run `berks outdated`
|
30
|
+
Then the output should contain:
|
31
|
+
"""
|
32
|
+
All cookbooks up to date!
|
33
|
+
"""
|
34
|
+
|
7
35
|
Scenario: the dependency has a no version constraint and there are new items
|
36
|
+
Given the Chef Server has cookbooks:
|
37
|
+
| bacon | 1.0.0 |
|
38
|
+
| bacon | 1.1.0 |
|
39
|
+
And the Berkshelf API server's cache is up to date
|
40
|
+
And the cookbook store has the cookbooks:
|
41
|
+
| bacon | 1.0.0 |
|
42
|
+
And I write to "Berksfile" with:
|
43
|
+
"""
|
44
|
+
source "http://localhost:26210"
|
45
|
+
|
46
|
+
cookbook 'bacon'
|
47
|
+
"""
|
48
|
+
And I write to "Berksfile.lock" with:
|
49
|
+
"""
|
50
|
+
{
|
51
|
+
"dependencies": {
|
52
|
+
"bacon": {
|
53
|
+
"locked_version": "1.0.0"
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
"""
|
58
|
+
When I successfully run `berks outdated`
|
59
|
+
Then the output should contain:
|
60
|
+
"""
|
61
|
+
The following cookbooks have newer versions:
|
62
|
+
* bacon (1.1.0) [http://localhost:26210]
|
63
|
+
"""
|
64
|
+
|
8
65
|
Scenario: the dependency has a version constraint and there are new items that satisfy it
|
66
|
+
Given the Chef Server has cookbooks:
|
67
|
+
| bacon | 1.1.0 |
|
68
|
+
| bacon | 1.2.1 |
|
69
|
+
| bacon | 1.5.8 |
|
70
|
+
And the Berkshelf API server's cache is up to date
|
71
|
+
And the cookbook store has the cookbooks:
|
72
|
+
| bacon | 1.0.0 |
|
73
|
+
And I write to "Berksfile" with:
|
74
|
+
"""
|
75
|
+
source "http://localhost:26210"
|
76
|
+
|
77
|
+
cookbook 'bacon', '~> 1.0'
|
78
|
+
"""
|
79
|
+
And I write to "Berksfile.lock" with:
|
80
|
+
"""
|
81
|
+
{
|
82
|
+
"dependencies": {
|
83
|
+
"bacon": {
|
84
|
+
"locked_version": "1.0.0"
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
"""
|
89
|
+
When I successfully run `berks outdated`
|
90
|
+
Then the output should contain:
|
91
|
+
"""
|
92
|
+
The following cookbooks have newer versions:
|
93
|
+
* bacon (1.5.8) [http://localhost:26210]
|
94
|
+
"""
|
95
|
+
|
96
|
+
Scenario: When there is no lockfile present
|
97
|
+
And I write to "Berksfile" with:
|
98
|
+
"""
|
99
|
+
source "http://localhost:26210"
|
100
|
+
|
101
|
+
cookbook 'bacon', '1.0.0'
|
102
|
+
"""
|
103
|
+
When I run `berks outdated`
|
104
|
+
Then the output should contain:
|
105
|
+
"""
|
106
|
+
Could not find cookbook 'bacon (>= 0.0.0)'. Try running `berks install` to download and install the missing dependencies.
|
107
|
+
"""
|
108
|
+
And the exit status should be "LockfileNotFound"
|
109
|
+
|
110
|
+
Scenario: When the cookbook is not installed
|
111
|
+
And I write to "Berksfile" with:
|
112
|
+
"""
|
113
|
+
source "http://localhost:26210"
|
114
|
+
|
115
|
+
cookbook 'bacon', '1.0.0'
|
116
|
+
"""
|
117
|
+
And I write to "Berksfile.lock" with:
|
118
|
+
"""
|
119
|
+
{
|
120
|
+
"dependencies": {
|
121
|
+
"bacon": {
|
122
|
+
"locked_version": "1.0.0"
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
126
|
+
"""
|
127
|
+
When I run `berks outdated`
|
128
|
+
Then the output should contain:
|
129
|
+
"""
|
130
|
+
Could not find cookbook 'bacon (= 1.0.0)'. Try running `berks install` to download and install the missing dependencies.
|
131
|
+
"""
|
132
|
+
And the exit status should be "CookbookNotFound"
|