berkshelf 3.0.0.beta6 → 3.0.0.beta7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/features/berksfile.feature +2 -0
  3. data/features/commands/apply.feature +1 -1
  4. data/features/commands/contingent.feature +5 -3
  5. data/features/commands/install.feature +40 -40
  6. data/features/commands/list.feature +42 -20
  7. data/features/commands/outdated.feature +60 -16
  8. data/features/commands/show.feature +51 -8
  9. data/features/commands/update.feature +43 -15
  10. data/features/commands/upload.feature +4 -1
  11. data/features/commands/vendor.feature +27 -0
  12. data/features/json_formatter.feature +20 -8
  13. data/features/lockfile.feature +192 -71
  14. data/generator_files/CHANGELOG.md.erb +5 -0
  15. data/lib/berkshelf/berksfile.rb +166 -139
  16. data/lib/berkshelf/cli.rb +33 -30
  17. data/lib/berkshelf/cookbook_generator.rb +1 -0
  18. data/lib/berkshelf/dependency.rb +64 -14
  19. data/lib/berkshelf/downloader.rb +7 -10
  20. data/lib/berkshelf/errors.rb +59 -11
  21. data/lib/berkshelf/formatters/human_readable.rb +23 -36
  22. data/lib/berkshelf/formatters/json.rb +25 -29
  23. data/lib/berkshelf/installer.rb +111 -122
  24. data/lib/berkshelf/locations/git_location.rb +22 -9
  25. data/lib/berkshelf/locations/mercurial_location.rb +20 -5
  26. data/lib/berkshelf/locations/path_location.rb +22 -7
  27. data/lib/berkshelf/lockfile.rb +435 -203
  28. data/lib/berkshelf/resolver.rb +4 -2
  29. data/lib/berkshelf/source.rb +10 -1
  30. data/lib/berkshelf/version.rb +1 -1
  31. data/spec/fixtures/cookbooks/example_cookbook/Berksfile.lock +3 -4
  32. data/spec/fixtures/lockfiles/2.0.lock +17 -0
  33. data/spec/fixtures/lockfiles/blank.lock +0 -0
  34. data/spec/fixtures/lockfiles/default.lock +18 -10
  35. data/spec/fixtures/lockfiles/empty.lock +3 -0
  36. data/spec/unit/berkshelf/berksfile_spec.rb +31 -74
  37. data/spec/unit/berkshelf/cookbook_generator_spec.rb +4 -0
  38. data/spec/unit/berkshelf/installer_spec.rb +4 -7
  39. data/spec/unit/berkshelf/lockfile_parser_spec.rb +124 -0
  40. data/spec/unit/berkshelf/lockfile_spec.rb +140 -163
  41. metadata +11 -6
  42. data/features/licenses.feature +0 -79
  43. data/features/step_definitions/lockfile_steps.rb +0 -57
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d964b87b02a233afac80f3028e97c532255f39db
4
- data.tar.gz: ef1dbe7bd58bde0cd23cdac93f02f9eb5df97085
3
+ metadata.gz: 093e4db16726fd19aa0f3851481f7f4223e8ddc5
4
+ data.tar.gz: 66efef230a148c0ac4a68db77a16722cce697b4c
5
5
  SHA512:
6
- metadata.gz: d99b5c0192551e43144b9f2a53496413141d2ba42f9c6a1ed21094970bf55a81e311f929a1b5d66ff8b2e3c400439f2e79f9b0fea27307e86cb81307a8b3ade0
7
- data.tar.gz: bf9bfb6ffcb4c018d963a3e032a65f1e7c89c62b7c129b390512e9436b34c758559fa7ad11e560440e8c67a5b5e2249c1fa046ff08504fe78971b3eee958a5b7
6
+ metadata.gz: 7604553987f1fd224a37128cf05d189873f96bcc4d96f1c4cee0e2ee9a45beeb5eefe8095012adfb1696c429e559fd16a58946ed8232f5310a9da428f414f447
7
+ data.tar.gz: 62e0a0d8b2df6393da22d846e857389b1b4e003dcb1f1d60c84d1011e878bd8732277e1ba715f09f694c64e2380d95975f25265daf1edbe05ea0d26d8af70f2e
@@ -2,6 +2,8 @@ Feature: Evaluating a Berksfile
2
2
  Scenario: Containing pure Ruby
3
3
  Given I write to "Berksfile" with:
4
4
  """
5
+ source 'https://api.berkshelf.com'
6
+
5
7
  if ENV['BACON']
6
8
  puts "If you don't got bacon..."
7
9
  else
@@ -36,6 +36,6 @@ Feature: berks apply
36
36
  When I run `berks apply my_env`
37
37
  Then the output should contain:
38
38
  """
39
- No lockfile found at Berksfile.lock
39
+ Lockfile not found! Run `berks install` to create the lockfile.
40
40
  """
41
41
  And the exit status should be "LockfileNotFound"
@@ -16,10 +16,11 @@ Feature: berks contingent
16
16
  cookbook 'fake', '1.0.0'
17
17
  cookbook 'ekaf', '1.0.0'
18
18
  """
19
+ And I run `berks install`
19
20
  And I successfully run `berks contingent dep`
20
21
  Then the output should contain:
21
22
  """
22
- Cookbooks in this Berksfile contingent upon dep:
23
+ Cookbooks in this Berksfile contingent upon 'dep':
23
24
  * ekaf (1.0.0)
24
25
  * fake (1.0.0)
25
26
  """
@@ -31,10 +32,11 @@ Feature: berks contingent
31
32
  """
32
33
  cookbook 'fake', '1.0.0'
33
34
  """
35
+ And I run `berks install`
34
36
  And I successfully run `berks contingent dep`
35
37
  Then the output should contain:
36
38
  """
37
- There are no cookbooks contingent upon 'dep' defined in this Berksfile
39
+ There are no cookbooks in this Berksfile contingent upon 'dep'.
38
40
  """
39
41
 
40
42
  Scenario: When the cookbook is not in the Berksfile
@@ -42,5 +44,5 @@ Feature: berks contingent
42
44
  And I successfully run `berks contingent dep`
43
45
  Then the output should contain:
44
46
  """
45
- There are no cookbooks contingent upon 'dep' defined in this Berksfile
47
+ There are no cookbooks in this Berksfile contingent upon 'dep'.
46
48
  """
@@ -56,8 +56,8 @@ Feature: berks install
56
56
  When I successfully run `berks install`
57
57
  Then the output should contain:
58
58
  """
59
- Installing ruby (1.0.0) from [api: http://0.0.0.0:26210] ([chef_server] http://localhost:26310/)
60
- Installing elixir (1.0.0) from [api: http://0.0.0.0:26210] ([chef_server] http://localhost:26310/)
59
+ Installing elixir (1.0.0) from http://0.0.0.0:26210 ([chef_server] http://localhost:26310/)
60
+ Installing ruby (1.0.0) from http://0.0.0.0:26210 ([chef_server] http://localhost:26310/)
61
61
  """
62
62
  And the cookbook store should have the cookbooks:
63
63
  | ruby | 1.0.0 |
@@ -101,7 +101,7 @@ Feature: berks install
101
101
  cookbook 'takeme', group: :take_me
102
102
  cookbook 'notme', group: :not_me
103
103
  """
104
- When I successfully run `berks upload --only take_me not_me`
104
+ When I successfully run `berks install --only take_me not_me`
105
105
  Then the output should contain "Using takeme (1.0.0)"
106
106
  Then the output should contain "Using notme (1.0.0)"
107
107
 
@@ -114,7 +114,7 @@ Feature: berks install
114
114
  cookbook 'takeme', group: :take_me
115
115
  cookbook 'notme', group: :not_me
116
116
  """
117
- When I successfully run `berks upload --except not_me`
117
+ When I successfully run `berks install --except not_me`
118
118
  Then the output should contain "Using takeme (1.0.0)"
119
119
  Then the output should not contain "Using notme (1.0.0)"
120
120
 
@@ -127,7 +127,7 @@ Feature: berks install
127
127
  cookbook 'takeme', group: :take_me
128
128
  cookbook 'notme', group: :not_me
129
129
  """
130
- When I successfully run `berks upload --except take_me not_me`
130
+ When I successfully run `berks install --except take_me not_me`
131
131
  Then the output should not contain "Using takeme (1.0.0)"
132
132
  Then the output should not contain "Using notme (1.0.0)"
133
133
 
@@ -140,7 +140,7 @@ Feature: berks install
140
140
  When I successfully run `berks install`
141
141
  Then the output should contain:
142
142
  """
143
- Using example_cookbook (0.5.0) path: '
143
+ Using example_cookbook (0.5.0) from source at ../../fixtures/cookbooks/example_cookbook-0.5.0
144
144
  """
145
145
 
146
146
  Scenario: installing a demand from a path location with a conflicting constraint
@@ -165,12 +165,12 @@ Feature: berks install
165
165
  When I successfully run `berks install`
166
166
  Then the output should contain:
167
167
  """
168
- Using example_cookbook (0.5.0) path: '
168
+ Using example_cookbook (0.5.0) from source at ../../fixtures/cookbooks/example_cookbook-0.5.0
169
169
  """
170
170
 
171
171
  Scenario: installing a demand from a path location locks the graph to that version
172
172
  Given the Chef Server has cookbooks:
173
- | example_cookbook | 1.0.0 | |
173
+ # | example_cookbook | 1.0.0 | |
174
174
  | other_cookbook | 1.0.0 | example_cookbook ~> 1.0.0 |
175
175
  And I have a Berksfile pointing at the local Berkshelf API with:
176
176
  """
@@ -192,7 +192,7 @@ Feature: berks install
192
192
  When I successfully run `berks install -b subdirectory/Berksfile`
193
193
  Then the output should contain:
194
194
  """
195
- Using example_cookbook (0.5.0) path: '
195
+ Using example_cookbook (0.5.0) from source at ../../../fixtures/cookbooks/example_cookbook-0.5.0
196
196
  """
197
197
 
198
198
  Scenario: installing a demand from a Git location
@@ -205,9 +205,9 @@ Feature: berks install
205
205
  | berkshelf-cookbook-fixture | 1.0.0 | a97b9447cbd41a5fe58eee2026e48ccb503bd3bc |
206
206
  And the output should contain:
207
207
  """
208
- Fetching 'berkshelf-cookbook-fixture' from git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'master'
209
- building universe...
210
- Using berkshelf-cookbook-fixture (1.0.0) git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'master'
208
+ Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at master)
209
+ Fetching cookbook index from http://0.0.0.0:26210...
210
+ Using berkshelf-cookbook-fixture (1.0.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at master)
211
211
  """
212
212
 
213
213
  Scenario: installing a demand from a Git location that has already been installed
@@ -220,7 +220,7 @@ Feature: berks install
220
220
  When I successfully run `berks install`
221
221
  Then the output should contain:
222
222
  """
223
- Using berkshelf-cookbook-fixture (1.0.0) git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'master'
223
+ Using berkshelf-cookbook-fixture (1.0.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at master)
224
224
  """
225
225
 
226
226
  Scenario: installing a Berksfile that contains a Git location with a rel
@@ -233,9 +233,9 @@ Feature: berks install
233
233
  | berkshelf-cookbook-fixture | 1.0.0 | 93f5768b7d14df45e10d16c8bf6fe98ba3ff809a |
234
234
  And the output should contain:
235
235
  """
236
- Fetching 'berkshelf-cookbook-fixture' from github: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'rel'
237
- building universe...
238
- Using berkshelf-cookbook-fixture (1.0.0) github: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'rel' at ref: '93f5768b7d14df45e10d16c8bf6fe98ba3ff809a'
236
+ Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at rel/cookbooks/berkshelf-cookbook-fixture)
237
+ Fetching cookbook index from http://0.0.0.0:26210...
238
+ Using berkshelf-cookbook-fixture (1.0.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at rel/cookbooks/berkshelf-cookbook-fixture)
239
239
  """
240
240
 
241
241
  Scenario: installing a Berksfile that contains a Git location with a tag
@@ -248,9 +248,9 @@ Feature: berks install
248
248
  | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
249
249
  And the output should contain:
250
250
  """
251
- Fetching 'berkshelf-cookbook-fixture' from git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'v0.2.0'
252
- building universe...
253
- Using berkshelf-cookbook-fixture (0.2.0) git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'v0.2.0' at ref: '70a527e17d91f01f031204562460ad1c17f972ee'
251
+ Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
252
+ Fetching cookbook index from http://0.0.0.0:26210...
253
+ Using berkshelf-cookbook-fixture (0.2.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
254
254
  """
255
255
 
256
256
  Scenario: installing a Berksfile that contains a Git location with a ref
@@ -263,24 +263,24 @@ Feature: berks install
263
263
  | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
264
264
  And the output should contain:
265
265
  """
266
- Fetching 'berkshelf-cookbook-fixture' from git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with ref: '70a527e17d91f01f031204562460ad1c17f972ee'
267
- building universe...
268
- Using berkshelf-cookbook-fixture (0.2.0) git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with ref: '70a527e17d91f01f031204562460ad1c17f972ee'
266
+ Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
267
+ Fetching cookbook index from http://0.0.0.0:26210...
268
+ Using berkshelf-cookbook-fixture (0.2.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
269
269
  """
270
270
 
271
271
  Scenario: installing a Berksfile that contains a Git location with an abbreviated ref
272
272
  Given I have a Berksfile pointing at the local Berkshelf API with:
273
273
  """
274
- cookbook "berkshelf-cookbook-fixture", git: "git://github.com/RiotGames/berkshelf-cookbook-fixture.git", ref: "70a527"
274
+ cookbook "berkshelf-cookbook-fixture", git: "git://github.com/RiotGames/berkshelf-cookbook-fixture.git", ref: "70a527e"
275
275
  """
276
276
  When I successfully run `berks install`
277
277
  Then the cookbook store should have the git cookbooks:
278
278
  | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
279
279
  And the output should contain:
280
280
  """
281
- Fetching 'berkshelf-cookbook-fixture' from git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with ref: '70a527'
282
- building universe...
283
- Using berkshelf-cookbook-fixture (0.2.0) git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with ref: '70a527' at ref: '70a527e17d91f01f031204562460ad1c17f972ee'
281
+ Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
282
+ Fetching cookbook index from http://0.0.0.0:26210...
283
+ Using berkshelf-cookbook-fixture (0.2.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
284
284
  """
285
285
 
286
286
  Scenario: installing a Berksfile that contains a GitHub location
@@ -293,9 +293,9 @@ Feature: berks install
293
293
  | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
294
294
  And the output should contain:
295
295
  """
296
- Fetching 'berkshelf-cookbook-fixture' from github: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'v0.2.0'
297
- building universe...
298
- Using berkshelf-cookbook-fixture (0.2.0) github: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'v0.2.0' at ref: '70a527e17d91f01f031204562460ad1c17f972ee'
296
+ Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
297
+ Fetching cookbook index from http://0.0.0.0:26210...
298
+ Using berkshelf-cookbook-fixture (0.2.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
299
299
  """
300
300
 
301
301
  Scenario: installing a Berksfile that contains a GitHub location ending in .git
@@ -320,9 +320,9 @@ Feature: berks install
320
320
  | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
321
321
  And the output should contain:
322
322
  """
323
- Fetching 'berkshelf-cookbook-fixture' from github: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'v0.2.0'
324
- building universe...
325
- Using berkshelf-cookbook-fixture (0.2.0) github: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'v0.2.0' at ref: '70a527e17d91f01f031204562460ad1c17f972ee'
323
+ Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
324
+ Fetching cookbook index from http://0.0.0.0:26210...
325
+ Using berkshelf-cookbook-fixture (0.2.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
326
326
  """
327
327
 
328
328
  Scenario: installing a Berksfile that contains a Github location and protocol https
@@ -335,9 +335,9 @@ Feature: berks install
335
335
  | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
336
336
  And the output should contain:
337
337
  """
338
- Fetching 'berkshelf-cookbook-fixture' from github: 'https://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'v0.2.0'
339
- building universe...
340
- Using berkshelf-cookbook-fixture (0.2.0) github: 'https://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'v0.2.0' at ref: '70a527e17d91f01f031204562460ad1c17f972ee'
338
+ Fetching 'berkshelf-cookbook-fixture' from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
339
+ Fetching cookbook index from http://0.0.0.0:26210...
340
+ Using berkshelf-cookbook-fixture (0.2.0) from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
341
341
  """
342
342
 
343
343
  # GitHub doesn't permit anonymous SSH access, so we are going to get a
@@ -471,7 +471,7 @@ Feature: berks install
471
471
  When I run `berks install`
472
472
  Then the output should contain:
473
473
  """
474
- Fetching 'berkshelf-cookbook-fixture' from git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'v0.2.0'
474
+ Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
475
475
  The cookbook downloaded for berkshelf-cookbook-fixture (= 1.0.0) did not satisfy the constraint.
476
476
  """
477
477
  And the exit status should be "CookbookValidationFailure"
@@ -486,9 +486,9 @@ Feature: berks install
486
486
  When I successfully run `berks install`
487
487
  Then the output should contain:
488
488
  """
489
- Fetching 'berkshelf-cookbook-fixture' from git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'v1.0.0'
490
- building universe...
491
- Using berkshelf-cookbook-fixture (1.0.0) git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git' with branch: 'v1.0.0' at ref: 'b4f968c9001ad8de30f564a2107fab9cfa91f771'
489
+ Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v1.0.0)
490
+ Fetching cookbook index from http://0.0.0.0:26210...
491
+ Using berkshelf-cookbook-fixture (1.0.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v1.0.0)
492
492
  """
493
493
 
494
494
  Scenario: with a cookbook definition containing an invalid option
@@ -512,7 +512,7 @@ Feature: berks install
512
512
  When I run `berks install`
513
513
  Then the output should contain:
514
514
  """
515
- Fetching 'doesntexist' from git: 'git://github.com/asdjhfkljashflkjashfakljsf' with branch: 'master'
515
+ Fetching 'doesntexist' from git://github.com/asdjhfkljashflkjashfakljsf (at master)
516
516
  An error occurred during Git execution:
517
517
  """
518
518
  And the exit status should be "GitError"
@@ -1,5 +1,5 @@
1
1
  Feature: berks list
2
- Scenario: Running the list command
2
+ Scenario: When everything is good
3
3
  Given the cookbook store has the cookbooks:
4
4
  | fake1 | 1.0.0 |
5
5
  | fake2 | 1.0.1 |
@@ -8,9 +8,16 @@ Feature: berks list
8
8
  cookbook 'fake1', '1.0.0'
9
9
  cookbook 'fake2', '1.0.1'
10
10
  """
11
- And the Lockfile has:
12
- | fake1 | 1.0.0 |
13
- | fake2 | 1.0.1 |
11
+ And I write to "Berksfile.lock" with:
12
+ """
13
+ DEPENDENCIES
14
+ fake1 (= 1.0.0)
15
+ fake2 (= 1.0.1)
16
+
17
+ GRAPH
18
+ fake1 (1.0.0)
19
+ fake2 (1.0.1)
20
+ """
14
21
  When I successfully run `berks list`
15
22
  Then the output should contain:
16
23
  """
@@ -19,38 +26,53 @@ Feature: berks list
19
26
  * fake2 (1.0.1)
20
27
  """
21
28
 
22
- Scenario: Running the list command when the dependencies aren't downloaded
23
- And I have a Berksfile pointing at the local Berkshelf API with:
29
+ Scenario: When the lockfile is not present
30
+ Given I have a Berksfile pointing at the local Berkshelf API with:
24
31
  """
25
32
  cookbook 'fake', '1.0.0'
26
33
  """
27
- And the Lockfile has:
28
- | fake | 1.0.0 |
29
34
  When I run `berks list`
30
35
  Then the output should contain:
31
36
  """
32
- Could not find cookbook 'fake (1.0.0)'.
37
+ Lockfile not found! Run `berks install` to create the lockfile.
33
38
  """
34
- And the exit status should be "CookbookNotFound"
39
+ And the exit status should be "LockfileNotFound"
35
40
 
36
- Scenario: Running the list command when the lockfile isn't present
37
- Given the cookbook store has the cookbooks:
38
- | fake | 1.0.0 |
39
- And I have a Berksfile pointing at the local Berkshelf API with:
41
+ Scenario: When a dependency is not in the lockfile
42
+ Given I have a Berksfile pointing at the local Berkshelf API with:
40
43
  """
41
44
  cookbook 'fake', '1.0.0'
42
45
  """
46
+ And I write to "Berksfile.lock" with:
47
+ """
48
+ DEPENDENCIES
49
+
50
+ GRAPH
51
+ not_fake (1.0.0)
52
+ """
43
53
  When I run `berks list`
44
54
  Then the output should contain:
45
55
  """
46
- Could not find cookbook 'fake (= 1.0.0)'.
56
+ The lockfile is out of sync! Run `berks install` to sync the lockfile.
47
57
  """
48
- And the exit status should be "CookbookNotFound"
58
+ And the exit status should be "LockfileOutOfSync"
49
59
 
50
- Scenario: Running the list command with no dependencies defined
51
- Given I have a Berksfile pointing at the local Berkshelf API
52
- When I successfully run `berks list`
60
+ Scenario: When a dependency is not installed
61
+ Given I have a Berksfile pointing at the local Berkshelf API with:
62
+ """
63
+ cookbook 'fake', '1.0.0'
64
+ """
65
+ And I write to "Berksfile.lock" with:
66
+ """
67
+ DEPENDENCIES
68
+ fake (= 1.0.0)
69
+
70
+ GRAPH
71
+ fake (1.0.0)
72
+ """
73
+ When I run `berks list`
53
74
  Then the output should contain:
54
75
  """
55
- There are no cookbooks installed by your Berksfile
76
+ The cookbook 'fake (1.0.0)' is not installed. Please run `berks install` to download and install the missing dependency.
56
77
  """
78
+ And the exit status should be "DependencyNotInstalled"
@@ -10,8 +10,15 @@ Feature: berks outdated
10
10
  """
11
11
  cookbook 'bacon', '~> 1.1.0'
12
12
  """
13
- And the Lockfile has:
14
- | bacon | 1.1.0 |
13
+ And I write to "Berksfile.lock" with:
14
+ """
15
+ DEPENDENCIES
16
+ bacon (~> 1.1.0)
17
+
18
+ GRAPH
19
+ bacon (1.1.0)
20
+ """
21
+
15
22
  When I successfully run `berks outdated`
16
23
  Then the output should contain:
17
24
  """
@@ -29,8 +36,14 @@ Feature: berks outdated
29
36
  """
30
37
  cookbook 'bacon'
31
38
  """
32
- And the Lockfile has:
33
- | bacon | 1.0.0 |
39
+ And I write to "Berksfile.lock" with:
40
+ """
41
+ DEPENDENCIES
42
+ bacon
43
+
44
+ GRAPH
45
+ bacon (1.0.0)
46
+ """
34
47
  When I successfully run `berks outdated`
35
48
  Then the output should contain:
36
49
  """
@@ -50,8 +63,14 @@ Feature: berks outdated
50
63
  """
51
64
  cookbook 'bacon', '~> 1.0'
52
65
  """
53
- And the Lockfile has:
54
- | bacon | 1.0.0 |
66
+ And I write to "Berksfile.lock" with:
67
+ """
68
+ DEPENDENCIES
69
+ bacon (~> 1.0)
70
+
71
+ GRAPH
72
+ bacon (1.0.0)
73
+ """
55
74
  When I successfully run `berks outdated`
56
75
  Then the output should contain:
57
76
  """
@@ -59,28 +78,53 @@ Feature: berks outdated
59
78
  * bacon (1.5.8)
60
79
  """
61
80
 
62
- Scenario: When there is no lockfile present
63
- And I have a Berksfile pointing at the local Berkshelf API with:
81
+ Scenario: When the lockfile is not present
82
+ Given I have a Berksfile pointing at the local Berkshelf API with:
64
83
  """
65
84
  cookbook 'bacon', '1.0.0'
66
85
  """
67
86
  When I run `berks outdated`
68
87
  Then the output should contain:
69
88
  """
70
- Could not find cookbook 'bacon (= 1.0.0)'. Try running `berks install` to download and install the missing dependencies.
89
+ Lockfile not found! Run `berks install` to create the lockfile.
71
90
  """
72
- And the exit status should be "CookbookNotFound"
91
+ And the exit status should be "LockfileNotFound"
73
92
 
74
- Scenario: When the cookbook is not installed
75
- And I have a Berksfile pointing at the local Berkshelf API with:
93
+ Scenario: When a dependency is not in the lockfile
94
+ Given I have a Berksfile pointing at the local Berkshelf API with:
76
95
  """
77
96
  cookbook 'bacon', '1.0.0'
78
97
  """
79
- And the Lockfile has:
80
- | bacon | 1.0.0 |
98
+ And I write to "Berksfile.lock" with:
99
+ """
100
+ DEPENDENCIES
101
+
102
+ GRAPH
103
+ not_fake (1.0.0)
104
+ """
105
+ When I run `berks outdated`
106
+ Then the output should contain:
107
+ """
108
+ The lockfile is out of sync! Run `berks install` to sync the lockfile.
109
+ """
110
+ And the exit status should be "LockfileOutOfSync"
111
+
112
+ Scenario: When a dependency is not installed
113
+ Given I have a Berksfile pointing at the local Berkshelf API with:
114
+ """
115
+ cookbook 'bacon', '1.0.0'
116
+ """
117
+ And I write to "Berksfile.lock" with:
118
+ """
119
+ DEPENDENCIES
120
+ bacon (= 1.0.0)
121
+
122
+ GRAPH
123
+ bacon (1.0.0)
124
+ """
81
125
  When I run `berks outdated`
82
126
  Then the output should contain:
83
127
  """
84
- Could not find cookbook 'bacon (1.0.0)'. Try running `berks install` to download and install the missing dependencies.
128
+ The cookbook 'bacon (1.0.0)' is not installed. Please run `berks install` to download and install the missing dependency.
85
129
  """
86
- And the exit status should be "CookbookNotFound"
130
+ And the exit status should be "DependencyNotInstalled"