berkshelf 6.3.4 → 7.0.0

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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +10 -0
  4. data/.travis.yml +6 -8
  5. data/CHANGELOG.md +7 -19
  6. data/Gemfile +10 -0
  7. data/Gemfile.lock +68 -103
  8. data/Thorfile +2 -2
  9. data/berkshelf.gemspec +6 -8
  10. data/features/commands/info.feature +50 -8
  11. data/features/commands/shelf/show.feature +10 -40
  12. data/features/commands/upload.feature +73 -0
  13. data/features/commands/vendor.feature +43 -0
  14. data/features/json_formatter.feature +1 -1
  15. data/features/step_definitions/chef_server_steps.rb +2 -2
  16. data/features/step_definitions/filesystem_steps.rb +16 -0
  17. data/features/support/env.rb +11 -10
  18. data/lib/berkshelf.rb +15 -20
  19. data/lib/berkshelf/berksfile.rb +57 -47
  20. data/lib/berkshelf/cached_cookbook.rb +120 -19
  21. data/lib/berkshelf/chef_config_compat.rb +50 -0
  22. data/lib/berkshelf/chef_repo_universe.rb +2 -2
  23. data/lib/berkshelf/cli.rb +3 -42
  24. data/lib/berkshelf/community_rest.rb +40 -61
  25. data/lib/berkshelf/config.rb +92 -118
  26. data/lib/berkshelf/cookbook_store.rb +3 -2
  27. data/lib/berkshelf/core_ext/file.rb +1 -1
  28. data/lib/berkshelf/dependency.rb +1 -10
  29. data/lib/berkshelf/downloader.rb +19 -7
  30. data/lib/berkshelf/errors.rb +3 -0
  31. data/lib/berkshelf/location.rb +1 -1
  32. data/lib/berkshelf/locations/base.rb +1 -1
  33. data/lib/berkshelf/lockfile.rb +17 -13
  34. data/lib/berkshelf/logger.rb +62 -1
  35. data/lib/berkshelf/packager.rb +1 -1
  36. data/lib/berkshelf/resolver.rb +1 -1
  37. data/lib/berkshelf/ridley_compat.rb +22 -3
  38. data/lib/berkshelf/uploader.rb +76 -48
  39. data/lib/berkshelf/version.rb +1 -1
  40. data/spec/fixtures/cookbook-path-uploader/apt-2.3.6/metadata.rb +2 -0
  41. data/spec/fixtures/cookbook-path-uploader/build-essential-1.4.2/metadata.rb +2 -0
  42. data/spec/fixtures/cookbook-path-uploader/jenkins-2.0.3/metadata.rb +5 -0
  43. data/spec/fixtures/cookbook-path-uploader/jenkins-config-0.1.0/metadata.rb +4 -0
  44. data/spec/fixtures/cookbook-path-uploader/runit-1.5.8/metadata.rb +5 -0
  45. data/spec/fixtures/cookbook-path-uploader/yum-3.0.6/metadata.rb +2 -0
  46. data/spec/fixtures/cookbook-path-uploader/yum-epel-0.2.0/metadata.rb +3 -0
  47. data/spec/spec_helper.rb +2 -2
  48. data/spec/support/chef_api.rb +4 -4
  49. data/spec/support/chef_server.rb +1 -1
  50. data/spec/support/matchers/file_system_matchers.rb +1 -3
  51. data/spec/support/path_helpers.rb +1 -1
  52. data/spec/unit/berkshelf/berksfile_spec.rb +3 -24
  53. data/spec/unit/berkshelf/cached_cookbook_spec.rb +13 -15
  54. data/spec/unit/berkshelf/community_rest_spec.rb +3 -12
  55. data/spec/unit/berkshelf/config_spec.rb +4 -4
  56. data/spec/unit/berkshelf/downloader_spec.rb +6 -11
  57. data/spec/unit/berkshelf/lockfile_spec.rb +10 -7
  58. data/spec/unit/berkshelf/source_spec.rb +1 -1
  59. data/spec/unit/berkshelf/ssl_policies_spec.rb +2 -5
  60. data/spec/unit/berkshelf/uploader_spec.rb +60 -10
  61. data/spec/unit/berkshelf/visualizer_spec.rb +2 -2
  62. metadata +49 -102
  63. data/features/commands/cookbook.feature +0 -35
  64. data/features/commands/init.feature +0 -27
  65. data/features/config.feature +0 -111
  66. data/lib/berkshelf/base_generator.rb +0 -42
  67. data/lib/berkshelf/cookbook_generator.rb +0 -133
  68. data/lib/berkshelf/init_generator.rb +0 -195
  69. data/lib/berkshelf/streaming_file_adapter.rb +0 -22
  70. data/spec/unit/berkshelf/cookbook_generator_spec.rb +0 -108
  71. data/spec/unit/berkshelf/init_generator_spec.rb +0 -265
@@ -37,7 +37,7 @@ module Berkshelf
37
37
 
38
38
  Visualizer.from_lockfile(lockfile).to_dot_file(outfile)
39
39
 
40
- expect(File.exists?(outfile)).to be true
40
+ expect(File.exist?(outfile)).to be true
41
41
  end
42
42
 
43
43
  it "builds a png from a Lockfile" do
@@ -46,7 +46,7 @@ module Berkshelf
46
46
 
47
47
  Visualizer.from_lockfile(lockfile).to_png(outfile)
48
48
 
49
- expect(File.exists?(outfile)).to be true
49
+ expect(File.exist?(outfile)).to be true
50
50
  end
51
51
  end
52
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkshelf
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.4
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Winsor
@@ -12,36 +12,8 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2018-08-07 00:00:00.000000000 Z
15
+ date: 2018-04-24 00:00:00.000000000 Z
16
16
  dependencies:
17
- - !ruby/object:Gem::Dependency
18
- name: buff-config
19
- requirement: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - "~>"
22
- - !ruby/object:Gem::Version
23
- version: '2.0'
24
- type: :runtime
25
- prerelease: false
26
- version_requirements: !ruby/object:Gem::Requirement
27
- requirements:
28
- - - "~>"
29
- - !ruby/object:Gem::Version
30
- version: '2.0'
31
- - !ruby/object:Gem::Dependency
32
- name: buff-extensions
33
- requirement: !ruby/object:Gem::Requirement
34
- requirements:
35
- - - "~>"
36
- - !ruby/object:Gem::Version
37
- version: '2.0'
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- requirements:
42
- - - "~>"
43
- - !ruby/object:Gem::Version
44
- version: '2.0'
45
17
  - !ruby/object:Gem::Dependency
46
18
  name: mixlib-shellout
47
19
  requirement: !ruby/object:Gem::Requirement
@@ -70,54 +42,20 @@ dependencies:
70
42
  - - "~>"
71
43
  - !ruby/object:Gem::Version
72
44
  version: '1.0'
73
- - !ruby/object:Gem::Dependency
74
- name: faraday
75
- requirement: !ruby/object:Gem::Requirement
76
- requirements:
77
- - - "~>"
78
- - !ruby/object:Gem::Version
79
- version: '0.9'
80
- type: :runtime
81
- prerelease: false
82
- version_requirements: !ruby/object:Gem::Requirement
83
- requirements:
84
- - - "~>"
85
- - !ruby/object:Gem::Version
86
- version: '0.9'
87
- - !ruby/object:Gem::Dependency
88
- name: httpclient
89
- requirement: !ruby/object:Gem::Requirement
90
- requirements:
91
- - - "~>"
92
- - !ruby/object:Gem::Version
93
- version: '2.7'
94
- type: :runtime
95
- prerelease: false
96
- version_requirements: !ruby/object:Gem::Requirement
97
- requirements:
98
- - - "~>"
99
- - !ruby/object:Gem::Version
100
- version: '2.7'
101
45
  - !ruby/object:Gem::Dependency
102
46
  name: minitar
103
47
  requirement: !ruby/object:Gem::Requirement
104
48
  requirements:
105
- - - "~>"
106
- - !ruby/object:Gem::Version
107
- version: '0.5'
108
49
  - - ">="
109
50
  - !ruby/object:Gem::Version
110
- version: 0.5.4
51
+ version: '0.6'
111
52
  type: :runtime
112
53
  prerelease: false
113
54
  version_requirements: !ruby/object:Gem::Requirement
114
55
  requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '0.5'
118
56
  - - ">="
119
57
  - !ruby/object:Gem::Version
120
- version: 0.5.4
58
+ version: '0.6'
121
59
  - !ruby/object:Gem::Dependency
122
60
  name: retryable
123
61
  requirement: !ruby/object:Gem::Requirement
@@ -132,20 +70,6 @@ dependencies:
132
70
  - - "~>"
133
71
  - !ruby/object:Gem::Version
134
72
  version: '2.0'
135
- - !ruby/object:Gem::Dependency
136
- name: ridley
137
- requirement: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - "~>"
140
- - !ruby/object:Gem::Version
141
- version: '5.0'
142
- type: :runtime
143
- prerelease: false
144
- version_requirements: !ruby/object:Gem::Requirement
145
- requirements:
146
- - - "~>"
147
- - !ruby/object:Gem::Version
148
- version: '5.0'
149
73
  - !ruby/object:Gem::Dependency
150
74
  name: solve
151
75
  requirement: !ruby/object:Gem::Requirement
@@ -228,20 +152,42 @@ dependencies:
228
152
  requirements:
229
153
  - - ">="
230
154
  - !ruby/object:Gem::Version
231
- version: 12.7.2
232
- - - "<"
155
+ version: 13.6.52
156
+ type: :runtime
157
+ prerelease: false
158
+ version_requirements: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
233
161
  - !ruby/object:Gem::Version
234
- version: '14.0'
162
+ version: 13.6.52
163
+ - !ruby/object:Gem::Dependency
164
+ name: chef-config
165
+ requirement: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
235
170
  type: :runtime
236
171
  prerelease: false
237
172
  version_requirements: !ruby/object:Gem::Requirement
238
173
  requirements:
239
174
  - - ">="
240
175
  - !ruby/object:Gem::Version
241
- version: 12.7.2
242
- - - "<"
176
+ version: '0'
177
+ - !ruby/object:Gem::Dependency
178
+ name: mixlib-config
179
+ requirement: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: 2.2.5
184
+ type: :runtime
185
+ prerelease: false
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - ">="
243
189
  - !ruby/object:Gem::Version
244
- version: '14.0'
190
+ version: 2.2.5
245
191
  description: Manages a Cookbook's, or an Application's, Cookbook dependencies
246
192
  email:
247
193
  - jamie@vialstudios.com
@@ -275,9 +221,7 @@ files:
275
221
  - features/berksfile.feature
276
222
  - features/commands/apply.feature
277
223
  - features/commands/contingent.feature
278
- - features/commands/cookbook.feature
279
224
  - features/commands/info.feature
280
- - features/commands/init.feature
281
225
  - features/commands/install.feature
282
226
  - features/commands/list.feature
283
227
  - features/commands/outdated.feature
@@ -293,7 +237,6 @@ files:
293
237
  - features/commands/verify.feature
294
238
  - features/commands/viz.feature
295
239
  - features/community_site.feature
296
- - features/config.feature
297
240
  - features/help.feature
298
241
  - features/json_formatter.feature
299
242
  - features/lifecycle.feature
@@ -335,15 +278,14 @@ files:
335
278
  - lib/berkshelf/api_client/errors.rb
336
279
  - lib/berkshelf/api_client/remote_cookbook.rb
337
280
  - lib/berkshelf/api_client/version.rb
338
- - lib/berkshelf/base_generator.rb
339
281
  - lib/berkshelf/berksfile.rb
340
282
  - lib/berkshelf/cached_cookbook.rb
283
+ - lib/berkshelf/chef_config_compat.rb
341
284
  - lib/berkshelf/chef_repo_universe.rb
342
285
  - lib/berkshelf/cli.rb
343
286
  - lib/berkshelf/commands/shelf.rb
344
287
  - lib/berkshelf/community_rest.rb
345
288
  - lib/berkshelf/config.rb
346
- - lib/berkshelf/cookbook_generator.rb
347
289
  - lib/berkshelf/cookbook_store.rb
348
290
  - lib/berkshelf/core_ext.rb
349
291
  - lib/berkshelf/core_ext/file.rb
@@ -358,7 +300,6 @@ files:
358
300
  - lib/berkshelf/formatters/human.rb
359
301
  - lib/berkshelf/formatters/json.rb
360
302
  - lib/berkshelf/formatters/null.rb
361
- - lib/berkshelf/init_generator.rb
362
303
  - lib/berkshelf/installer.rb
363
304
  - lib/berkshelf/location.rb
364
305
  - lib/berkshelf/locations/base.rb
@@ -378,7 +319,6 @@ files:
378
319
  - lib/berkshelf/source.rb
379
320
  - lib/berkshelf/source_uri.rb
380
321
  - lib/berkshelf/ssl_policies.rb
381
- - lib/berkshelf/streaming_file_adapter.rb
382
322
  - lib/berkshelf/thor.rb
383
323
  - lib/berkshelf/thor_ext.rb
384
324
  - lib/berkshelf/thor_ext/hash_with_indifferent_access.rb
@@ -395,6 +335,13 @@ files:
395
335
  - spec/fixtures/complex-cookbook-path/cookbooks/app/metadata.rb
396
336
  - spec/fixtures/complex-cookbook-path/cookbooks/jenkins-config/metadata.rb
397
337
  - spec/fixtures/complex-cookbook-path/cookbooks/jenkins/metadata.rb
338
+ - spec/fixtures/cookbook-path-uploader/apt-2.3.6/metadata.rb
339
+ - spec/fixtures/cookbook-path-uploader/build-essential-1.4.2/metadata.rb
340
+ - spec/fixtures/cookbook-path-uploader/jenkins-2.0.3/metadata.rb
341
+ - spec/fixtures/cookbook-path-uploader/jenkins-config-0.1.0/metadata.rb
342
+ - spec/fixtures/cookbook-path-uploader/runit-1.5.8/metadata.rb
343
+ - spec/fixtures/cookbook-path-uploader/yum-3.0.6/metadata.rb
344
+ - spec/fixtures/cookbook-path-uploader/yum-epel-0.2.0/metadata.rb
398
345
  - spec/fixtures/cookbook-path/jenkins-config/metadata.rb
399
346
  - spec/fixtures/cookbook-store/jenkins-2.0.3/metadata.rb
400
347
  - spec/fixtures/cookbook-store/jenkins-2.0.4/metadata.rb
@@ -431,7 +378,6 @@ files:
431
378
  - spec/unit/berkshelf/cli_spec.rb
432
379
  - spec/unit/berkshelf/community_rest_spec.rb
433
380
  - spec/unit/berkshelf/config_spec.rb
434
- - spec/unit/berkshelf/cookbook_generator_spec.rb
435
381
  - spec/unit/berkshelf/cookbook_store_spec.rb
436
382
  - spec/unit/berkshelf/core_ext/file_utils_spec.rb
437
383
  - spec/unit/berkshelf/core_ext/pathname_spec.rb
@@ -443,7 +389,6 @@ files:
443
389
  - spec/unit/berkshelf/formatters/human_spec.rb
444
390
  - spec/unit/berkshelf/formatters/json_spec.rb
445
391
  - spec/unit/berkshelf/formatters/null_spec.rb
446
- - spec/unit/berkshelf/init_generator_spec.rb
447
392
  - spec/unit/berkshelf/installer_spec.rb
448
393
  - spec/unit/berkshelf/location_spec.rb
449
394
  - spec/unit/berkshelf/locations/base_spec.rb
@@ -476,7 +421,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
476
421
  requirements:
477
422
  - - ">="
478
423
  - !ruby/object:Gem::Version
479
- version: 2.3.1
424
+ version: 2.4.0
480
425
  required_rubygems_version: !ruby/object:Gem::Requirement
481
426
  requirements:
482
427
  - - ">="
@@ -484,7 +429,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
484
429
  version: 2.0.0
485
430
  requirements: []
486
431
  rubyforge_project:
487
- rubygems_version: 2.7.7
432
+ rubygems_version: 2.7.6
488
433
  signing_key:
489
434
  specification_version: 4
490
435
  summary: Manages a Cookbook's, or an Application's, Cookbook dependencies
@@ -493,9 +438,7 @@ test_files:
493
438
  - features/berksfile.feature
494
439
  - features/commands/apply.feature
495
440
  - features/commands/contingent.feature
496
- - features/commands/cookbook.feature
497
441
  - features/commands/info.feature
498
- - features/commands/init.feature
499
442
  - features/commands/install.feature
500
443
  - features/commands/list.feature
501
444
  - features/commands/outdated.feature
@@ -511,7 +454,6 @@ test_files:
511
454
  - features/commands/verify.feature
512
455
  - features/commands/viz.feature
513
456
  - features/community_site.feature
514
- - features/config.feature
515
457
  - features/help.feature
516
458
  - features/json_formatter.feature
517
459
  - features/lifecycle.feature
@@ -537,6 +479,13 @@ test_files:
537
479
  - spec/fixtures/complex-cookbook-path/cookbooks/app/metadata.rb
538
480
  - spec/fixtures/complex-cookbook-path/cookbooks/jenkins-config/metadata.rb
539
481
  - spec/fixtures/complex-cookbook-path/cookbooks/jenkins/metadata.rb
482
+ - spec/fixtures/cookbook-path-uploader/apt-2.3.6/metadata.rb
483
+ - spec/fixtures/cookbook-path-uploader/build-essential-1.4.2/metadata.rb
484
+ - spec/fixtures/cookbook-path-uploader/jenkins-2.0.3/metadata.rb
485
+ - spec/fixtures/cookbook-path-uploader/jenkins-config-0.1.0/metadata.rb
486
+ - spec/fixtures/cookbook-path-uploader/runit-1.5.8/metadata.rb
487
+ - spec/fixtures/cookbook-path-uploader/yum-3.0.6/metadata.rb
488
+ - spec/fixtures/cookbook-path-uploader/yum-epel-0.2.0/metadata.rb
540
489
  - spec/fixtures/cookbook-path/jenkins-config/metadata.rb
541
490
  - spec/fixtures/cookbook-store/jenkins-2.0.3/metadata.rb
542
491
  - spec/fixtures/cookbook-store/jenkins-2.0.4/metadata.rb
@@ -573,7 +522,6 @@ test_files:
573
522
  - spec/unit/berkshelf/cli_spec.rb
574
523
  - spec/unit/berkshelf/community_rest_spec.rb
575
524
  - spec/unit/berkshelf/config_spec.rb
576
- - spec/unit/berkshelf/cookbook_generator_spec.rb
577
525
  - spec/unit/berkshelf/cookbook_store_spec.rb
578
526
  - spec/unit/berkshelf/core_ext/file_utils_spec.rb
579
527
  - spec/unit/berkshelf/core_ext/pathname_spec.rb
@@ -585,7 +533,6 @@ test_files:
585
533
  - spec/unit/berkshelf/formatters/human_spec.rb
586
534
  - spec/unit/berkshelf/formatters/json_spec.rb
587
535
  - spec/unit/berkshelf/formatters/null_spec.rb
588
- - spec/unit/berkshelf/init_generator_spec.rb
589
536
  - spec/unit/berkshelf/installer_spec.rb
590
537
  - spec/unit/berkshelf/location_spec.rb
591
538
  - spec/unit/berkshelf/locations/base_spec.rb
@@ -1,35 +0,0 @@
1
- Feature: berks cookbook
2
- Scenario: With the default options
3
- When I successfully run `berks cookbook sparkle_motion`
4
- Then I should have a new cookbook skeleton "sparkle_motion"
5
-
6
- Scenario Outline: With various options
7
- When I successfully run `berks cookbook sparkle_motion --<option>`
8
- Then I should have a new cookbook skeleton "sparkle_motion" with <feature> support
9
- Examples:
10
- | option | feature |
11
- | foodcritic | Foodcritic |
12
- | chef-minitest | Chef-Minitest |
13
- | scmversion | SCMVersion |
14
- | no-bundler | no Bundler |
15
- # Disable testing of skip git until Test Kitchen supports the skip_git flag in its generator
16
- # https://github.com/opscode/test-kitchen/issues/141
17
- # | skip-git | no Git |
18
- | skip-vagrant | no Vagrant |
19
- | skip-test-kitchen | no Test Kitchen |
20
-
21
- Scenario Outline: When a required supporting gem is not installed
22
- Given the gem "<gem>" is not installed
23
- When I successfully run `berks cookbook sparkle_motion --<option>`
24
- Then I should have a new cookbook skeleton "sparkle_motion" with <feature> support
25
- And the output should contain a warning to suggest supporting the option "<option>" by installing "<gem>"
26
- Examples:
27
- | option | feature | gem |
28
- | foodcritic | Foodcritic | foodcritic |
29
- | scmversion | SCMVersion | thor-scmversion |
30
-
31
- Scenario: When bundler is not installed
32
- Given the gem "bundler" is not installed
33
- When I successfully run `berks cookbook sparkle_motion`
34
- Then I should have a new cookbook skeleton "sparkle_motion"
35
- And the output should contain a warning to suggest supporting the default for "bundler" by installing "bundler"
@@ -1,27 +0,0 @@
1
- Feature: berks init
2
- Scenario: initializing a path containing a cookbook
3
- Given a cookbook named "sparkle_motion"
4
- When I successfully run `berks init sparkle_motion`
5
- Then the cookbook "sparkle_motion" should have the following files:
6
- | Berksfile |
7
- | chefignore |
8
- And the file "Berksfile" in the cookbook "sparkle_motion" should contain:
9
- """
10
- metadata
11
- """
12
- And the output should contain "Successfully initialized"
13
-
14
- Scenario: initializing a path that does not contain a cookbook
15
- Given a directory named "not_a_cookbook"
16
- When I run `berks init not_a_cookbook`
17
- And the exit status should be "NotACookbook"
18
-
19
- Scenario: initializing with no value given for target
20
- Given I write to "metadata.rb" with:
21
- """
22
- name 'sparkle_motion'
23
- """
24
- When I successfully run `berks init`
25
- Then the output should contain "Successfully initialized"
26
- And a file named "Berksfile" should exist
27
- And a file named "chefignore" should exist
@@ -1,111 +0,0 @@
1
- Feature: Reading a Berkshelf configuration file
2
- Scenario: Missing a Berkshelf configuration file
3
- When I successfully run `berks cookbook sparkle_motion`
4
- Then the resulting "sparkle_motion" Vagrantfile should contain:
5
- | config.omnibus.chef_version = 'latest' |
6
- | config.vm.box = 'bento/ubuntu-14.04' |
7
-
8
- Scenario: Using a Berkshelf configuration file that sets the vagrant-omnibus plugin chef version
9
- Given I have a Berkshelf config file containing:
10
- """
11
- {
12
- "vagrant": {
13
- "omnibus": {
14
- "version": "11.4.4"
15
- },
16
- "vm": {
17
- "box": "bento/ubuntu-14.04",
18
- "forward_port": {
19
- "12345": "54321"
20
- }
21
- }
22
- }
23
- }
24
- """
25
- When I successfully run `berks cookbook sparkle_motion`
26
- Then the resulting "sparkle_motion" Vagrantfile should contain:
27
- | config.omnibus.chef_version = '11.4.4' |
28
- | config.vm.box = 'bento/ubuntu-14.04' |
29
- | config.vm.network :forwarded_port, guest: 12345, host: 54321 |
30
- | config.vm.network :private_network, type: 'dhcp' |
31
- And the exit status should be 0
32
-
33
- Scenario: Using a Berkshelf configuration file that sets the vagrant-omnibus plugin chef version to latest
34
- Given I have a Berkshelf config file containing:
35
- """
36
- {
37
- "vagrant": {
38
- "omnibus": {
39
- "version": "latest"
40
- },
41
- "vm": {
42
- "box": "bento/ubuntu-14.04",
43
- "forward_port": {
44
- "12345": "54321"
45
- }
46
- }
47
- }
48
- }
49
- """
50
- When I successfully run `berks cookbook sparkle_motion`
51
- Then the resulting "sparkle_motion" Vagrantfile should contain:
52
- | config.omnibus.chef_version = 'latest' |
53
- | config.vm.box = 'bento/ubuntu-14.04' |
54
- | config.vm.network :forwarded_port, guest: 12345, host: 54321 |
55
- | config.vm.network :private_network, type: 'dhcp' |
56
-
57
- Scenario: Using a partial Berkshelf configuration file
58
- Given I have a Berkshelf config file containing:
59
- """
60
- {
61
- "vagrant": {
62
- "vm": {
63
- "forward_port": {
64
- "12345": "54321"
65
- }
66
- }
67
- }
68
- }
69
- """
70
- When I successfully run `berks cookbook sparkle_motion`
71
- Then the resulting "sparkle_motion" Vagrantfile should contain:
72
- | config.vm.network :forwarded_port, guest: 12345, host: 54321 |
73
-
74
- Scenario: Using an invalid Berkshelf configuration file
75
- Given I have a Berkshelf config file containing:
76
- """
77
- {
78
- "vagrant": {
79
- "vm": {
80
- "box": 1
81
- }
82
- }
83
- }
84
- """
85
- When I run `berks cookbook sparkle_motion`
86
- Then the output should contain "Invalid configuration"
87
- And the output should contain "vagrant.vm.box Expected attribute: 'vagrant.vm.box' to be a type of: 'String'"
88
- And the exit status should be "InvalidConfiguration"
89
-
90
- Scenario: Using a Berkshelf configuration file with Chef configuration information
91
- Given I have a Berkshelf config file containing:
92
- """
93
- {
94
- "chef": {
95
- "chef_server_url": "localhost:4000",
96
- "validation_client_name": "my_client-validator",
97
- "validation_key_path": "/a/b/c/my_client-validator.pem"
98
- },
99
- "vagrant": {
100
- "vm": {
101
- "provision": "chef_client"
102
- }
103
- }
104
- }
105
- """
106
- When I successfully run `berks cookbook sparkle_motion`
107
- Then the resulting "sparkle_motion" Vagrantfile should contain:
108
- | config.vm.provision :chef_client |
109
- | chef.chef_server_url = 'localhost:4000' |
110
- | chef.validation_client_name = 'my_client-validator' |
111
- | chef.validation_key_path = '/a/b/c/my_client-validator.pem' |