berkshelf 1.0.4 → 1.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/.rbenv-version +1 -1
- data/.rvmrc +1 -0
- data/features/{install.feature → install_command.feature} +46 -34
- data/features/list_command.feature +24 -0
- data/features/outdated_command.feature +56 -0
- data/features/show_command.feature +26 -0
- data/features/step_definitions/chef_server_steps.rb +6 -0
- data/features/step_definitions/cli_steps.rb +0 -4
- data/features/support/env.rb +4 -4
- data/features/update_command.feature +55 -0
- data/features/upload_command.feature +197 -0
- data/lib/berkshelf/berksfile.rb +99 -3
- data/lib/berkshelf/cached_cookbook.rb +4 -0
- data/lib/berkshelf/cli.rb +89 -14
- data/lib/berkshelf/errors.rb +31 -0
- data/lib/berkshelf/locations/github_location.rb +1 -1
- data/lib/berkshelf/lockfile.rb +29 -17
- data/lib/berkshelf/vagrant/action/clean.rb +2 -0
- data/lib/berkshelf/vagrant/action/install.rb +2 -0
- data/lib/berkshelf/vagrant/action/upload.rb +2 -0
- data/lib/berkshelf/version.rb +1 -1
- data/spec/support/chef_api.rb +4 -1
- data/spec/unit/berkshelf/errors_spec.rb +14 -0
- data/spec/unit/berkshelf/init_generator_spec.rb +3 -1
- metadata +18 -12
- data/features/update.feature +0 -19
data/.rbenv-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.3-
|
1
|
+
1.9.3-p327
|
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm 1.9.3-p327@berkshelf --create
|
@@ -8,7 +8,7 @@ Feature: install cookbooks from a Berksfile
|
|
8
8
|
"""
|
9
9
|
cookbook "mysql", "1.2.4"
|
10
10
|
"""
|
11
|
-
When I run
|
11
|
+
When I successfully run `berks install`
|
12
12
|
Then the cookbook store should have the cookbooks:
|
13
13
|
| mysql | 1.2.4 |
|
14
14
|
| openssl | 1.0.0 |
|
@@ -26,13 +26,30 @@ Feature: install cookbooks from a Berksfile
|
|
26
26
|
"""
|
27
27
|
cookbook "mysql", "= 1.2.4"
|
28
28
|
"""
|
29
|
-
When I run
|
29
|
+
When I successfully run `berks install`
|
30
30
|
Then the output should contain:
|
31
31
|
"""
|
32
32
|
Using mysql (1.2.4)
|
33
33
|
"""
|
34
34
|
And the exit status should be 0
|
35
35
|
|
36
|
+
Scenario: installing a Berksfile that has multiple cookbooks in different groups
|
37
|
+
Given the cookbook store has the cookbooks:
|
38
|
+
| build-essential | 1.1.2 |
|
39
|
+
And I write to "Berksfile" with:
|
40
|
+
"""
|
41
|
+
group :a do
|
42
|
+
cookbook "build-essential", "1.1.2"
|
43
|
+
end
|
44
|
+
|
45
|
+
group :b do
|
46
|
+
cookbook "build-essential", "1.1.2"
|
47
|
+
end
|
48
|
+
"""
|
49
|
+
When I successfully run `berks install`
|
50
|
+
Then the output should contain "Using build-essential (1.1.2)"
|
51
|
+
And the exit status should be 0
|
52
|
+
|
36
53
|
Scenario: installing a Berksfile that contains a source with dependencies, all of which already have been installed
|
37
54
|
Given the cookbook store contains a cookbook "mysql" "1.2.4" with dependencies:
|
38
55
|
| openssl | = 1.0.0 |
|
@@ -45,7 +62,7 @@ Feature: install cookbooks from a Berksfile
|
|
45
62
|
"""
|
46
63
|
cookbook "mysql", "~> 1.2.0"
|
47
64
|
"""
|
48
|
-
When I run
|
65
|
+
When I successfully run `berks install`
|
49
66
|
Then the output should contain:
|
50
67
|
"""
|
51
68
|
Using mysql (1.2.4)
|
@@ -58,7 +75,7 @@ Feature: install cookbooks from a Berksfile
|
|
58
75
|
Scenario: installing a Berksfile that contains a path location
|
59
76
|
Given a Berksfile with path location sources to fixtures:
|
60
77
|
| example_cookbook | example_cookbook-0.5.0 |
|
61
|
-
When I run
|
78
|
+
When I successfully run `berks install`
|
62
79
|
Then the output should contain:
|
63
80
|
"""
|
64
81
|
Using example_cookbook (0.5.0) at path:
|
@@ -70,7 +87,7 @@ Feature: install cookbooks from a Berksfile
|
|
70
87
|
"""
|
71
88
|
cookbook "artifact", git: "git://github.com/RiotGames/artifact-cookbook.git", ref: "0.9.8"
|
72
89
|
"""
|
73
|
-
When I run
|
90
|
+
When I successfully run `berks install`
|
74
91
|
Then the cookbook store should have the git cookbooks:
|
75
92
|
| artifact | 0.9.8 | c0a0b456a4716a81645bef1369f5fd1a4e62ce6d |
|
76
93
|
And the output should contain:
|
@@ -84,7 +101,7 @@ Feature: install cookbooks from a Berksfile
|
|
84
101
|
"""
|
85
102
|
cookbook "artifact", github: "RiotGames/artifact-cookbook", ref: "0.9.8"
|
86
103
|
"""
|
87
|
-
When I run
|
104
|
+
When I successfully run `berks install`
|
88
105
|
Then the cookbook store should have the git cookbooks:
|
89
106
|
| artifact | 0.9.8 | c0a0b456a4716a81645bef1369f5fd1a4e62ce6d |
|
90
107
|
And the output should contain:
|
@@ -93,31 +110,26 @@ Feature: install cookbooks from a Berksfile
|
|
93
110
|
"""
|
94
111
|
And the exit status should be 0
|
95
112
|
|
96
|
-
Scenario
|
113
|
+
Scenario: installing a Berksfile that contains a Github location and the default protocol
|
97
114
|
Given I write to "Berksfile" with:
|
98
115
|
"""
|
99
|
-
cookbook "artifact", github: "RiotGames/artifact-cookbook", ref: "0.9.8"
|
116
|
+
cookbook "artifact", github: "RiotGames/artifact-cookbook", ref: "0.9.8"
|
100
117
|
"""
|
101
|
-
When I run
|
118
|
+
When I successfully run `berks install`
|
102
119
|
Then the cookbook store should have the git cookbooks:
|
103
120
|
| artifact | 0.9.8 | c0a0b456a4716a81645bef1369f5fd1a4e62ce6d |
|
104
121
|
And the output should contain:
|
105
122
|
"""
|
106
|
-
Installing artifact (0.9.8) from github: 'RiotGames/artifact-cookbook' with branch: '0.9.8'
|
123
|
+
Installing artifact (0.9.8) from github: 'RiotGames/artifact-cookbook' with branch: '0.9.8' over protocol: 'git'
|
107
124
|
"""
|
108
125
|
And the exit status should be 0
|
109
126
|
|
110
|
-
Examples:
|
111
|
-
| command postfix |
|
112
|
-
| , protocol: "git" |
|
113
|
-
| |
|
114
|
-
|
115
127
|
Scenario Outline: installing a Berksfile that contains a Github location and specific protocol
|
116
128
|
Given I write to "Berksfile" with:
|
117
129
|
"""
|
118
130
|
cookbook "artifact", github: "RiotGames/artifact-cookbook", ref: "0.9.8", protocol: "<protocol>"
|
119
131
|
"""
|
120
|
-
When I run
|
132
|
+
When I successfully run `berks install`
|
121
133
|
Then the cookbook store should have the git cookbooks:
|
122
134
|
| artifact | 0.9.8 | c0a0b456a4716a81645bef1369f5fd1a4e62ce6d |
|
123
135
|
And the output should contain:
|
@@ -138,19 +150,19 @@ Feature: install cookbooks from a Berksfile
|
|
138
150
|
"""
|
139
151
|
cookbook "artifact", github: "RiotGames/artifact-cookbook", ref: "0.9.8", protocol: "somethingabsurd"
|
140
152
|
"""
|
141
|
-
When I run
|
153
|
+
When I run `berks install`
|
142
154
|
Then the output should contain:
|
143
155
|
"""
|
144
156
|
'somethingabsurd' is not a supported Git protocol for the 'github' location key. Please use 'git' instead.
|
145
157
|
"""
|
146
|
-
And the exit status should be 110
|
158
|
+
And the exit status should be 110
|
147
159
|
|
148
160
|
Scenario: installing a Berksfile that contains an explicit site location
|
149
161
|
Given I write to "Berksfile" with:
|
150
162
|
"""
|
151
163
|
cookbook "mysql", "1.2.4", site: "http://cookbooks.opscode.com/api/v1/cookbooks"
|
152
164
|
"""
|
153
|
-
When I run
|
165
|
+
When I successfully run `berks install`
|
154
166
|
Then the cookbook store should have the cookbooks:
|
155
167
|
| mysql | 1.2.4 |
|
156
168
|
| openssl | 1.0.0 |
|
@@ -168,7 +180,7 @@ Feature: install cookbooks from a Berksfile
|
|
168
180
|
metadata
|
169
181
|
"""
|
170
182
|
When I cd to "sparkle_motion"
|
171
|
-
And I run
|
183
|
+
And I successfully run `berks install`
|
172
184
|
Then the output should contain:
|
173
185
|
"""
|
174
186
|
Using sparkle_motion (0.0.0) at path:
|
@@ -178,7 +190,7 @@ Feature: install cookbooks from a Berksfile
|
|
178
190
|
Scenario: running install with no Berksfile or Berksfile.lock
|
179
191
|
Given I do not have a Berksfile
|
180
192
|
And I do not have a Berksfile.lock
|
181
|
-
When I run
|
193
|
+
When I run `berks install`
|
182
194
|
Then the output should contain:
|
183
195
|
"""
|
184
196
|
No Berksfile or Berksfile.lock found at:
|
@@ -190,7 +202,7 @@ Feature: install cookbooks from a Berksfile
|
|
190
202
|
"""
|
191
203
|
cookbook "doesntexist"
|
192
204
|
"""
|
193
|
-
And I run
|
205
|
+
And I run `berks install`
|
194
206
|
Then the output should contain:
|
195
207
|
"""
|
196
208
|
Cookbook 'doesntexist' not found in any of the default locations
|
@@ -202,23 +214,23 @@ Feature: install cookbooks from a Berksfile
|
|
202
214
|
"""
|
203
215
|
cookbook "nginx", git: "/something/on/disk"
|
204
216
|
"""
|
205
|
-
When I run
|
217
|
+
When I run `berks install`
|
206
218
|
Then the output should contain:
|
207
219
|
"""
|
208
220
|
'/something/on/disk' is not a valid Git URI.
|
209
221
|
"""
|
210
222
|
And the CLI should exit with the status code for error "InvalidGitURI"
|
211
223
|
|
212
|
-
Scenario: installing when there are sources with duplicate names defined
|
224
|
+
Scenario: installing when there are sources with duplicate names defined in the same group
|
213
225
|
Given I write to "Berksfile" with:
|
214
226
|
"""
|
215
227
|
cookbook "artifact"
|
216
228
|
cookbook "artifact"
|
217
229
|
"""
|
218
|
-
When I run
|
230
|
+
When I run `berks install`
|
219
231
|
Then the output should contain:
|
220
232
|
"""
|
221
|
-
Berksfile contains
|
233
|
+
Berksfile contains multiple sources named 'artifact'. Use only one, or put them in different groups.
|
222
234
|
"""
|
223
235
|
And the CLI should exit with the status code for error "DuplicateSourceDefined"
|
224
236
|
|
@@ -227,7 +239,7 @@ Feature: install cookbooks from a Berksfile
|
|
227
239
|
"""
|
228
240
|
cookbook "artifact", "= 0.9.8", git: "git://github.com/RiotGames/artifact-cookbook.git", ref: "0.10.0"
|
229
241
|
"""
|
230
|
-
When I run
|
242
|
+
When I run `berks install`
|
231
243
|
Then the output should contain:
|
232
244
|
"""
|
233
245
|
A cookbook satisfying 'artifact' (= 0.9.8) not found at git: 'git://github.com/RiotGames/artifact-cookbook.git' with branch: '0.10.0'
|
@@ -241,7 +253,7 @@ Feature: install cookbooks from a Berksfile
|
|
241
253
|
"""
|
242
254
|
And the cookbook store has the cookbooks:
|
243
255
|
| artifact | 0.10.0 |
|
244
|
-
When I run
|
256
|
+
When I successfully run `berks install`
|
245
257
|
Then the output should contain:
|
246
258
|
"""
|
247
259
|
Installing artifact (0.10.0) from git: 'git://github.com/RiotGames/artifact-cookbook.git' with branch: '0.10.0'
|
@@ -253,7 +265,7 @@ Feature: install cookbooks from a Berksfile
|
|
253
265
|
"""
|
254
266
|
cookbook "artifact", whatisthis: "I don't even know", anotherwat: "isthat"
|
255
267
|
"""
|
256
|
-
When I run
|
268
|
+
When I run `berks install`
|
257
269
|
Then the output should contain:
|
258
270
|
"""
|
259
271
|
Invalid options for Cookbook Source: 'whatisthis', 'anotherwat'.
|
@@ -268,7 +280,7 @@ Feature: install cookbooks from a Berksfile
|
|
268
280
|
"""
|
269
281
|
And the Chef server has cookbooks:
|
270
282
|
| artifact | 0.10.2 |
|
271
|
-
When I run
|
283
|
+
When I successfully run `berks install`
|
272
284
|
Then the output should contain:
|
273
285
|
"""
|
274
286
|
Installing artifact (0.10.2) from chef_api:
|
@@ -295,7 +307,7 @@ Feature: install cookbooks from a Berksfile
|
|
295
307
|
"""
|
296
308
|
cookbook "artifact", chef_api: "https://api.opscode.com/organizations/vialstudios", client_key: "/Users/reset/.chef/knife.rb"
|
297
309
|
"""
|
298
|
-
When I run
|
310
|
+
When I run `berks install`
|
299
311
|
Then the output should contain:
|
300
312
|
"""
|
301
313
|
Source 'artifact' is a 'chef_api' location with a URL for it's value but is missing options: 'node_name'.
|
@@ -307,7 +319,7 @@ Feature: install cookbooks from a Berksfile
|
|
307
319
|
"""
|
308
320
|
cookbook "artifact", chef_api: "https://api.opscode.com/organizations/vialstudios", node_name: "reset"
|
309
321
|
"""
|
310
|
-
When I run
|
322
|
+
When I run `berks install`
|
311
323
|
Then the output should contain:
|
312
324
|
"""
|
313
325
|
Source 'artifact' is a 'chef_api' location with a URL for it's value but is missing options: 'client_key'.
|
@@ -319,7 +331,7 @@ Feature: install cookbooks from a Berksfile
|
|
319
331
|
"""
|
320
332
|
cookbook "artifact", chef_api: "https://api.opscode.com/organizations/vialstudios"
|
321
333
|
"""
|
322
|
-
When I run
|
334
|
+
When I run `berks install`
|
323
335
|
Then the output should contain:
|
324
336
|
"""
|
325
337
|
Source 'artifact' is a 'chef_api' location with a URL for it's value but is missing options: 'node_name', 'client_key'.
|
@@ -332,7 +344,7 @@ Feature: install cookbooks from a Berksfile
|
|
332
344
|
cookbook "ohai"
|
333
345
|
cookbook "doesntexist", git: "git://github.com/asdjhfkljashflkjashfakljsf"
|
334
346
|
"""
|
335
|
-
When I run
|
347
|
+
When I run `berks install`
|
336
348
|
Then the output should contain:
|
337
349
|
"""
|
338
350
|
Installing ohai (1.1.2) from site: 'http://cookbooks.opscode.com/api/v1/cookbooks'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: list command
|
2
|
+
As a user with a Berksfile
|
3
|
+
I want a way to show all my cookbooks and their versions without opening my Berksfile
|
4
|
+
So that I can be more productive
|
5
|
+
|
6
|
+
@slow_process
|
7
|
+
Scenario: Running the list command
|
8
|
+
Given I write to "Berksfile" with:
|
9
|
+
"""
|
10
|
+
cookbook "build-essential", "1.2.0"
|
11
|
+
cookbook "chef-client", "1.2.0"
|
12
|
+
cookbook "mysql", "1.2.4"
|
13
|
+
"""
|
14
|
+
And I successfully run `berks install`
|
15
|
+
When I run `berks list`
|
16
|
+
Then the output should contain:
|
17
|
+
"""
|
18
|
+
Cookbooks installed by your Berksfile:
|
19
|
+
* build-essential (1.2.0)
|
20
|
+
* chef-client (1.2.0)
|
21
|
+
* mysql (1.2.4)
|
22
|
+
* openssl (1.0.0)
|
23
|
+
"""
|
24
|
+
And the exit status should be 0
|
@@ -0,0 +1,56 @@
|
|
1
|
+
Feature: outdated command
|
2
|
+
As a user
|
3
|
+
I want to know what cookbooks are outdated before I run update
|
4
|
+
So that I can decide whether to update everything at once
|
5
|
+
|
6
|
+
Scenario: Running berks outdated with no version constraints
|
7
|
+
Given I write to "Berksfile" with:
|
8
|
+
"""
|
9
|
+
cookbook "artifact"
|
10
|
+
cookbook "build-essential"
|
11
|
+
"""
|
12
|
+
When I run `berks outdated`
|
13
|
+
Then the output should contain:
|
14
|
+
"""
|
15
|
+
Listing outdated cookbooks with newer versions available...
|
16
|
+
"""
|
17
|
+
And the output should contain:
|
18
|
+
"""
|
19
|
+
All cookbooks up to date
|
20
|
+
"""
|
21
|
+
|
22
|
+
Scenario: Running berks outdated with satisfied version constraints
|
23
|
+
Given I write to "Berksfile" with:
|
24
|
+
"""
|
25
|
+
cookbook "artifact", ">= 0.11.0"
|
26
|
+
cookbook "build-essential", ">= 1.0.0"
|
27
|
+
"""
|
28
|
+
When I run `berks outdated`
|
29
|
+
Then the output should contain:
|
30
|
+
"""
|
31
|
+
Listing outdated cookbooks with newer versions available...
|
32
|
+
"""
|
33
|
+
And the output should contain:
|
34
|
+
"""
|
35
|
+
All cookbooks up to date
|
36
|
+
"""
|
37
|
+
|
38
|
+
Scenario: Running berks outdated with unsatisfied version constraints
|
39
|
+
Given I write to "Berksfile" with:
|
40
|
+
"""
|
41
|
+
cookbook "artifact", "~> 0.9.0"
|
42
|
+
cookbook "build-essential", "~> 0.7.0"
|
43
|
+
"""
|
44
|
+
When I run `berks outdated`
|
45
|
+
Then the output should contain:
|
46
|
+
"""
|
47
|
+
Listing outdated cookbooks with newer versions available...
|
48
|
+
"""
|
49
|
+
And the output should contain:
|
50
|
+
"""
|
51
|
+
Cookbook 'artifact (~> 0.9.0)' is outdated
|
52
|
+
"""
|
53
|
+
And the output should contain:
|
54
|
+
"""
|
55
|
+
Cookbook 'build-essential (~> 0.7.0)' is outdated
|
56
|
+
"""
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Feature: show command
|
2
|
+
As a user with a Berksfile
|
3
|
+
I want a way to show the path to a cookbooks on my local file system
|
4
|
+
So that I can view the source and debug
|
5
|
+
|
6
|
+
Scenario: Running the show command with an installed cookbook name
|
7
|
+
Given I write to "Berksfile" with:
|
8
|
+
"""
|
9
|
+
cookbook "build-essential", "1.2.0"
|
10
|
+
cookbook "chef-client", "1.2.0"
|
11
|
+
cookbook "mysql", "1.2.4"
|
12
|
+
"""
|
13
|
+
And I successfully run `berks install`
|
14
|
+
When I run `berks show build-essential`
|
15
|
+
Then the output should contain "berkshelf/tmp/berkshelf/cookbooks/build-essential-1.2.0"
|
16
|
+
And the exit status should be 0
|
17
|
+
|
18
|
+
Scenario: Running the show command with a not installed cookbook name
|
19
|
+
Given I write to "Berksfile" with:
|
20
|
+
"""
|
21
|
+
cookbook "mysql", "1.2.4"
|
22
|
+
"""
|
23
|
+
And I successfully run `berks install`
|
24
|
+
When I run `berks show build-essential`
|
25
|
+
Then the output should contain "Cookbook 'build-essential' was not installed by your Berksfile"
|
26
|
+
And the CLI should exit with the status code for error "CookbookNotFound"
|
@@ -19,3 +19,9 @@ Then /^the Chef server should have the cookbooks:$/ do |cookbooks|
|
|
19
19
|
server_has_cookbook?(name, version).should be_true
|
20
20
|
end
|
21
21
|
end
|
22
|
+
|
23
|
+
Then /^the Chef server should not have the cookbooks:$/ do |cookbooks|
|
24
|
+
cookbooks.raw.each do |name, version|
|
25
|
+
server_has_cookbook?(name, version).should be_false
|
26
|
+
end
|
27
|
+
end
|
@@ -46,10 +46,6 @@ When /^I run the install command with flags:$/ do |flags|
|
|
46
46
|
run_simple(unescape("berks install #{flags.raw.join(" ")}"), false)
|
47
47
|
end
|
48
48
|
|
49
|
-
When /^I run the update command$/ do
|
50
|
-
run_simple(unescape("berks update"), true)
|
51
|
-
end
|
52
|
-
|
53
49
|
When /^I run the upload command$/ do
|
54
50
|
run_simple(unescape("berks upload"), true)
|
55
51
|
end
|
data/features/support/env.rb
CHANGED
@@ -12,9 +12,9 @@ Spork.prefork do
|
|
12
12
|
APP_ROOT = File.expand_path('../../../', __FILE__)
|
13
13
|
|
14
14
|
ENV["BERKSHELF_PATH"] = File.join(APP_ROOT, "tmp", "berkshelf")
|
15
|
-
ENV["BERKSHELF_CHEF_CONFIG"] = File.join(APP_ROOT, "
|
16
|
-
|
17
|
-
# Workaround for RSA Fingerprint prompt in Travis CI
|
15
|
+
ENV["BERKSHELF_CHEF_CONFIG"] = File.join(APP_ROOT, "spec", "knife.rb")
|
16
|
+
|
17
|
+
# Workaround for RSA Fingerprint prompt in Travis CI
|
18
18
|
git_ssh_path = '/tmp/git_ssh.sh'
|
19
19
|
unless File.exist? git_ssh_path
|
20
20
|
git_ssh = File.new(git_ssh_path, 'w+')
|
@@ -38,7 +38,7 @@ Spork.prefork do
|
|
38
38
|
Before do
|
39
39
|
clean_cookbook_store
|
40
40
|
@aruba_io_wait_seconds = 5
|
41
|
-
@aruba_timeout_seconds =
|
41
|
+
@aruba_timeout_seconds = 16
|
42
42
|
end
|
43
43
|
|
44
44
|
Before('@slow_process') do
|
@@ -0,0 +1,55 @@
|
|
1
|
+
Feature: update
|
2
|
+
As a user
|
3
|
+
I want a way to update the versions without clearing out the files I've downloaded
|
4
|
+
So that I can update faster than a clean install
|
5
|
+
|
6
|
+
Scenario: knife berkshelf update
|
7
|
+
Given I write to "Berksfile" with:
|
8
|
+
"""
|
9
|
+
cookbook "artifact", "0.10.0"
|
10
|
+
"""
|
11
|
+
Given I write to "Berksfile.lock" with:
|
12
|
+
"""
|
13
|
+
cookbook 'artifact', :locked_version => '0.1.0'
|
14
|
+
"""
|
15
|
+
When I successfully run `berks update`
|
16
|
+
Then the file "Berksfile.lock" should contain exactly:
|
17
|
+
"""
|
18
|
+
cookbook 'artifact', :locked_version => '0.10.0'
|
19
|
+
"""
|
20
|
+
|
21
|
+
Scenario: knife berkshelf update a single cookbook
|
22
|
+
Given I write to "Berksfile" with:
|
23
|
+
"""
|
24
|
+
cookbook "artifact", "0.10.0"
|
25
|
+
cookbook "build-essential", "~> 1.1.0"
|
26
|
+
"""
|
27
|
+
Given I write to "Berksfile.lock" with:
|
28
|
+
"""
|
29
|
+
cookbook 'artifact', :locked_version => '0.10.0'
|
30
|
+
cookbook 'build-essential', :locked_version => '1.1.0'
|
31
|
+
"""
|
32
|
+
When I successfully run `berks update build-essential`
|
33
|
+
Then the file "Berksfile.lock" should contain exactly:
|
34
|
+
"""
|
35
|
+
cookbook 'artifact', :locked_version => '0.10.0'
|
36
|
+
cookbook 'build-essential', :locked_version => '1.1.2'
|
37
|
+
"""
|
38
|
+
|
39
|
+
Scenario: knife berkshelf update a cookbook that isn't in the Berksfile
|
40
|
+
Given I write to "Berksfile" with:
|
41
|
+
"""
|
42
|
+
cookbook "artifact", "0.10.0"
|
43
|
+
cookbook "build-essential", "~> 1.1.0"
|
44
|
+
"""
|
45
|
+
Given I write to "Berksfile.lock" with:
|
46
|
+
"""
|
47
|
+
cookbook 'artifact', :locked_version => '0.10.0'
|
48
|
+
cookbook 'build-essential', :locked_version => '1.1.0'
|
49
|
+
"""
|
50
|
+
When I run `berks update foo`
|
51
|
+
Then the output should contain:
|
52
|
+
"""
|
53
|
+
Could not find cookbooks 'foo' in any of the sources. Is it in your Berksfile?
|
54
|
+
"""
|
55
|
+
And the CLI should exit with the status code for error "CookbookNotFound"
|