berkshelf 5.2.0 → 8.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +19 -47
  3. data/Rakefile +14 -4
  4. data/berkshelf.gemspec +61 -40
  5. data/bin/berks +2 -2
  6. data/lib/berkshelf/api-client.rb +1 -0
  7. data/lib/berkshelf/api_client/chef_server_connection.rb +29 -0
  8. data/lib/berkshelf/api_client/connection.rb +57 -0
  9. data/lib/berkshelf/api_client/errors.rb +10 -0
  10. data/lib/berkshelf/api_client/remote_cookbook.rb +56 -0
  11. data/lib/berkshelf/api_client/version.rb +5 -0
  12. data/lib/berkshelf/api_client.rb +24 -0
  13. data/lib/berkshelf/berksfile.rb +149 -122
  14. data/lib/berkshelf/cached_cookbook.rb +127 -24
  15. data/lib/berkshelf/chef_config_compat.rb +51 -0
  16. data/lib/berkshelf/chef_repo_universe.rb +47 -0
  17. data/lib/berkshelf/cli.rb +143 -174
  18. data/lib/berkshelf/commands/shelf.rb +20 -19
  19. data/lib/berkshelf/community_rest.rb +59 -94
  20. data/lib/berkshelf/config.rb +97 -127
  21. data/lib/berkshelf/cookbook_store.rb +7 -6
  22. data/lib/berkshelf/core_ext/file.rb +1 -1
  23. data/lib/berkshelf/core_ext/file_utils.rb +4 -4
  24. data/lib/berkshelf/core_ext.rb +1 -1
  25. data/lib/berkshelf/dependency.rb +25 -32
  26. data/lib/berkshelf/downloader.rb +66 -39
  27. data/lib/berkshelf/errors.rb +23 -17
  28. data/lib/berkshelf/file_syncer.rb +24 -47
  29. data/lib/berkshelf/formatters/human.rb +7 -5
  30. data/lib/berkshelf/formatters/json.rb +6 -6
  31. data/lib/berkshelf/installer.rb +120 -111
  32. data/lib/berkshelf/location.rb +14 -14
  33. data/lib/berkshelf/locations/base.rb +1 -1
  34. data/lib/berkshelf/locations/git.rb +16 -24
  35. data/lib/berkshelf/locations/github.rb +2 -2
  36. data/lib/berkshelf/locations/path.rb +2 -2
  37. data/lib/berkshelf/lockfile.rb +326 -328
  38. data/lib/berkshelf/logger.rb +64 -1
  39. data/lib/berkshelf/mixin/git.rb +6 -5
  40. data/lib/berkshelf/packager.rb +44 -10
  41. data/lib/berkshelf/resolver/graph.rb +1 -1
  42. data/lib/berkshelf/resolver.rb +4 -4
  43. data/lib/berkshelf/ridley_compat.rb +109 -0
  44. data/lib/berkshelf/shell.rb +2 -1
  45. data/lib/berkshelf/shell_out.rb +18 -0
  46. data/lib/berkshelf/source.rb +77 -33
  47. data/lib/berkshelf/source_uri.rb +4 -4
  48. data/lib/berkshelf/ssl_policies.rb +38 -0
  49. data/lib/berkshelf/thor.rb +1 -1
  50. data/lib/berkshelf/thor_ext/hash_with_indifferent_access.rb +1 -1
  51. data/lib/berkshelf/thor_ext.rb +1 -1
  52. data/lib/berkshelf/uploader.rb +106 -70
  53. data/lib/berkshelf/validator.rb +13 -5
  54. data/lib/berkshelf/version.rb +1 -1
  55. data/lib/berkshelf/visualizer.rb +16 -11
  56. data/lib/berkshelf.rb +106 -81
  57. data/spec/config/knife.rb +4 -4
  58. data/spec/data/trusted_certs/example.crt +22 -0
  59. data/spec/fixtures/Berksfile +3 -3
  60. data/spec/fixtures/complex-cookbook-path/cookbooks/app/metadata.rb +2 -0
  61. data/spec/fixtures/complex-cookbook-path/cookbooks/jenkins/metadata.rb +2 -0
  62. data/spec/fixtures/complex-cookbook-path/cookbooks/jenkins-config/metadata.rb +4 -0
  63. data/spec/fixtures/cookbook-path/jenkins-config/metadata.rb +3 -3
  64. data/spec/fixtures/cookbook-path-uploader/apt-2.3.6/metadata.rb +2 -0
  65. data/spec/fixtures/cookbook-path-uploader/build-essential-1.4.2/metadata.rb +2 -0
  66. data/spec/fixtures/cookbook-path-uploader/jenkins-2.0.3/metadata.rb +5 -0
  67. data/spec/fixtures/cookbook-path-uploader/jenkins-config-0.1.0/metadata.rb +4 -0
  68. data/spec/fixtures/cookbook-path-uploader/runit-1.5.8/metadata.rb +5 -0
  69. data/spec/fixtures/cookbook-path-uploader/yum-3.0.6/metadata.rb +2 -0
  70. data/spec/fixtures/cookbook-path-uploader/yum-epel-0.2.0/metadata.rb +3 -0
  71. data/spec/fixtures/cookbook-store/jenkins-2.0.3/metadata.rb +5 -5
  72. data/spec/fixtures/cookbook-store/jenkins-2.0.4/metadata.rb +4 -4
  73. data/spec/fixtures/cookbooks/example_cookbook/metadata.rb +3 -3
  74. data/spec/fixtures/cookbooks/example_cookbook-0.5.0/metadata.rb +3 -3
  75. data/spec/spec_helper.rb +56 -64
  76. data/spec/support/chef_api.rb +15 -16
  77. data/spec/support/chef_server.rb +71 -69
  78. data/spec/support/git.rb +59 -58
  79. data/spec/support/kitchen.rb +0 -14
  80. data/spec/support/matchers/file_system_matchers.rb +4 -5
  81. data/spec/support/matchers/filepath_matchers.rb +2 -2
  82. data/spec/support/path_helpers.rb +17 -17
  83. data/spec/support/shared_examples/formatter.rb +1 -1
  84. data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/attributes/default.rb +0 -0
  85. data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/files/default/file.h +0 -0
  86. data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/metadata.rb +2 -0
  87. data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/recipes/default.rb +0 -0
  88. data/spec/tmp/berkshelf/cookbooks/fake-0.1.0/templates/default/template.erb +0 -0
  89. data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/attributes/default.rb +0 -0
  90. data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/files/default/file.h +0 -0
  91. data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/metadata.rb +2 -0
  92. data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/recipes/default.rb +0 -0
  93. data/spec/tmp/berkshelf/cookbooks/fake-0.2.0/templates/default/template.erb +0 -0
  94. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/attributes/default.rb +0 -0
  95. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/files/default/file.h +0 -0
  96. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/metadata.rb +2 -0
  97. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/recipes/default.rb +0 -0
  98. data/spec/tmp/berkshelf/cookbooks/fake-1.0.0/templates/default/template.erb +0 -0
  99. data/spec/unit/berkshelf/berksfile_spec.rb +84 -105
  100. data/spec/unit/berkshelf/berkshelf/api_client/chef_server_connection_spec.rb +65 -0
  101. data/spec/unit/berkshelf/berkshelf/api_client/connection_spec.rb +157 -0
  102. data/spec/unit/berkshelf/berkshelf/api_client/remote_cookbook_spec.rb +23 -0
  103. data/spec/unit/berkshelf/berkshelf/api_client_spec.rb +9 -0
  104. data/spec/unit/berkshelf/cached_cookbook_spec.rb +45 -47
  105. data/spec/unit/berkshelf/chef_repo_universe_spec.rb +37 -0
  106. data/spec/unit/berkshelf/cli_spec.rb +7 -8
  107. data/spec/unit/berkshelf/community_rest_spec.rb +82 -90
  108. data/spec/unit/berkshelf/config_spec.rb +51 -22
  109. data/spec/unit/berkshelf/cookbook_store_spec.rb +41 -41
  110. data/spec/unit/berkshelf/core_ext/file_utils_spec.rb +7 -8
  111. data/spec/unit/berkshelf/core_ext/pathname_spec.rb +1 -1
  112. data/spec/unit/berkshelf/dependency_spec.rb +48 -48
  113. data/spec/unit/berkshelf/downloader_spec.rb +191 -34
  114. data/spec/unit/berkshelf/errors_spec.rb +3 -3
  115. data/spec/unit/berkshelf/file_syncer_spec.rb +87 -87
  116. data/spec/unit/berkshelf/formatters/base_spec.rb +23 -23
  117. data/spec/unit/berkshelf/formatters/human_spec.rb +2 -2
  118. data/spec/unit/berkshelf/formatters/json_spec.rb +2 -2
  119. data/spec/unit/berkshelf/formatters/null_spec.rb +3 -3
  120. data/spec/unit/berkshelf/installer_spec.rb +8 -8
  121. data/spec/unit/berkshelf/location_spec.rb +11 -11
  122. data/spec/unit/berkshelf/locations/base_spec.rb +35 -36
  123. data/spec/unit/berkshelf/locations/git_spec.rb +90 -93
  124. data/spec/unit/berkshelf/locations/path_spec.rb +40 -41
  125. data/spec/unit/berkshelf/lockfile_parser_spec.rb +71 -71
  126. data/spec/unit/berkshelf/lockfile_spec.rb +205 -211
  127. data/spec/unit/berkshelf/logger_spec.rb +3 -3
  128. data/spec/unit/berkshelf/mixin/logging_spec.rb +5 -5
  129. data/spec/unit/berkshelf/packager_spec.rb +2 -2
  130. data/spec/unit/berkshelf/resolver/graph_spec.rb +10 -8
  131. data/spec/unit/berkshelf/resolver_spec.rb +17 -17
  132. data/spec/unit/berkshelf/ridley_compat_spec.rb +16 -0
  133. data/spec/unit/berkshelf/shell_spec.rb +34 -34
  134. data/spec/unit/berkshelf/source_spec.rb +186 -20
  135. data/spec/unit/berkshelf/source_uri_spec.rb +1 -1
  136. data/spec/unit/berkshelf/ssl_policies_spec.rb +86 -0
  137. data/spec/unit/berkshelf/uploader_spec.rb +146 -64
  138. data/spec/unit/berkshelf/validator_spec.rb +23 -16
  139. data/spec/unit/berkshelf/visualizer_spec.rb +24 -15
  140. data/spec/unit/berkshelf_spec.rb +18 -18
  141. metadata +138 -289
  142. data/.gitignore +0 -29
  143. data/.travis.yml +0 -64
  144. data/CHANGELOG.legacy.md +0 -307
  145. data/CHANGELOG.md +0 -1358
  146. data/CONTRIBUTING.md +0 -64
  147. data/Gemfile.lock +0 -399
  148. data/Guardfile +0 -23
  149. data/PLUGINS.md +0 -25
  150. data/README.md +0 -70
  151. data/Thorfile +0 -61
  152. data/appveyor.yml +0 -31
  153. data/docs/berkshelf_for_newcomers.md +0 -65
  154. data/features/berksfile.feature +0 -46
  155. data/features/commands/apply.feature +0 -41
  156. data/features/commands/contingent.feature +0 -48
  157. data/features/commands/cookbook.feature +0 -35
  158. data/features/commands/info.feature +0 -99
  159. data/features/commands/init.feature +0 -27
  160. data/features/commands/install.feature +0 -636
  161. data/features/commands/list.feature +0 -78
  162. data/features/commands/outdated.feature +0 -130
  163. data/features/commands/package.feature +0 -17
  164. data/features/commands/search.feature +0 -17
  165. data/features/commands/shelf/list.feature +0 -32
  166. data/features/commands/shelf/show.feature +0 -143
  167. data/features/commands/shelf/uninstall.feature +0 -96
  168. data/features/commands/show.feature +0 -83
  169. data/features/commands/update.feature +0 -142
  170. data/features/commands/upload.feature +0 -426
  171. data/features/commands/vendor.feature +0 -111
  172. data/features/commands/verify.feature +0 -29
  173. data/features/commands/viz.feature +0 -66
  174. data/features/community_site.feature +0 -37
  175. data/features/config.feature +0 -111
  176. data/features/help.feature +0 -11
  177. data/features/json_formatter.feature +0 -161
  178. data/features/lifecycle.feature +0 -378
  179. data/features/lockfile.feature +0 -378
  180. data/features/step_definitions/berksfile_steps.rb +0 -39
  181. data/features/step_definitions/chef/config_steps.rb +0 -12
  182. data/features/step_definitions/chef_server_steps.rb +0 -60
  183. data/features/step_definitions/cli_steps.rb +0 -18
  184. data/features/step_definitions/config_steps.rb +0 -46
  185. data/features/step_definitions/environment_steps.rb +0 -7
  186. data/features/step_definitions/filesystem_steps.rb +0 -269
  187. data/features/step_definitions/gem_steps.rb +0 -13
  188. data/features/step_definitions/json_steps.rb +0 -23
  189. data/features/step_definitions/utility_steps.rb +0 -11
  190. data/features/support/aruba.rb +0 -12
  191. data/features/support/env.rb +0 -82
  192. data/generator_files/Berksfile.erb +0 -11
  193. data/generator_files/CHANGELOG.md.erb +0 -3
  194. data/generator_files/Gemfile.erb +0 -8
  195. data/generator_files/README.md.erb +0 -42
  196. data/generator_files/Thorfile.erb +0 -11
  197. data/generator_files/Vagrantfile.erb +0 -117
  198. data/generator_files/chefignore +0 -94
  199. data/generator_files/default_recipe.erb +0 -6
  200. data/generator_files/default_test.rb.erb +0 -11
  201. data/generator_files/gitignore.erb +0 -23
  202. data/generator_files/helpers.rb.erb +0 -7
  203. data/generator_files/licenses/apachev2.erb +0 -13
  204. data/generator_files/licenses/gplv2.erb +0 -15
  205. data/generator_files/licenses/gplv3.erb +0 -14
  206. data/generator_files/licenses/mit.erb +0 -20
  207. data/generator_files/licenses/reserved.erb +0 -3
  208. data/generator_files/metadata.rb.erb +0 -11
  209. data/lib/berkshelf/base_generator.rb +0 -43
  210. data/lib/berkshelf/commands/test_command.rb +0 -13
  211. data/lib/berkshelf/cookbook_generator.rb +0 -133
  212. data/lib/berkshelf/init_generator.rb +0 -195
  213. data/spec/fixtures/cookbooks/example_cookbook/.gitignore +0 -2
  214. data/spec/fixtures/cookbooks/example_cookbook/.kitchen.yml +0 -26
  215. data/spec/unit/berkshelf/cookbook_generator_spec.rb +0 -110
  216. data/spec/unit/berkshelf/init_generator_spec.rb +0 -263
@@ -1,636 +0,0 @@
1
- Feature: berks install
2
- Background:
3
- * the Berkshelf API server's cache is empty
4
- * the Chef Server is empty
5
- * the cookbook store is empty
6
-
7
- Scenario: installing the version that best satisfies our demand
8
- Given I have a Berksfile pointing at the local Berkshelf API with:
9
- """
10
- cookbook 'berkshelf'
11
- """
12
- And the Chef Server has cookbooks:
13
- | berkshelf | 1.0.0 |
14
- | berkshelf | 2.0.0 |
15
- And the Berkshelf API server's cache is up to date
16
- When I successfully run `berks install`
17
- Then the output should contain:
18
- """
19
- Installing berkshelf (2.0.0)
20
- """
21
- And the cookbook store should have the cookbooks:
22
- | berkshelf | 2.0.0 |
23
-
24
- Scenario: installing an explicit version demand
25
- Given I have a Berksfile pointing at the local Berkshelf API with:
26
- """
27
- cookbook 'berkshelf', '1.0.0'
28
- """
29
- And the Chef Server has cookbooks:
30
- | berkshelf | 1.0.0 |
31
- | berkshelf | 2.0.0 |
32
- And the Berkshelf API server's cache is up to date
33
- When I successfully run `berks install`
34
- Then the output should contain:
35
- """
36
- Installing berkshelf (1.0.0)
37
- """
38
- And the cookbook store should have the cookbooks:
39
- | berkshelf | 1.0.0 |
40
-
41
- Scenario: installing demands from all groups
42
- Given I have a Berksfile pointing at the local Berkshelf API with:
43
- """
44
- group :one do
45
- cookbook 'ruby'
46
- end
47
-
48
- group :two do
49
- cookbook 'elixir'
50
- end
51
- """
52
- And the Chef Server has cookbooks:
53
- | ruby | 1.0.0 |
54
- | elixir | 1.0.0 |
55
- And the Berkshelf API server's cache is up to date
56
- When I successfully run `berks install`
57
- Then the output should contain "Installing elixir (1.0.0)"
58
- And the output should contain "Installing ruby (1.0.0)"
59
- And the cookbook store should have the cookbooks:
60
- | ruby | 1.0.0 |
61
- | elixir | 1.0.0 |
62
-
63
- Scenario: installing a demand that has already been installed
64
- Given I have a Berksfile pointing at the local Berkshelf API with:
65
- """
66
- cookbook 'berkshelf-cookbook-fixture',
67
- github: 'RiotGames/berkshelf-cookbook-fixture',
68
- branch: 'deps'
69
- """
70
- And the cookbook store contains a cookbook "berkshelf" "1.0.0" with dependencies:
71
- | hostsfile | = 1.0.1 |
72
- And the cookbook store has the cookbooks:
73
- | hostsfile | 1.0.1 |
74
- And the Berkshelf API server's cache is up to date
75
- When I successfully run `berks install`
76
- Then the output should contain:
77
- """
78
- Using hostsfile (1.0.1)
79
- """
80
-
81
- Scenario: installing a single groups of demands with the --only flag
82
- Given the cookbook store has the cookbooks:
83
- | takeme | 1.0.0 |
84
- | notme | 1.0.0 |
85
- And I have a Berksfile pointing at the local Berkshelf API with:
86
- """
87
- cookbook 'takeme', group: :take_me
88
- cookbook 'notme', group: :not_me
89
- """
90
- When I successfully run `berks install --only take_me`
91
- Then the output should contain "Using takeme (1.0.0)"
92
- Then the output should not contain "Using notme (1.0.0)"
93
-
94
- Scenario: installing multiple groups of demands with the --only flag
95
- Given the cookbook store has the cookbooks:
96
- | takeme | 1.0.0 |
97
- | notme | 1.0.0 |
98
- And I have a Berksfile pointing at the local Berkshelf API with:
99
- """
100
- cookbook 'takeme', group: :take_me
101
- cookbook 'notme', group: :not_me
102
- """
103
- When I successfully run `berks install --only take_me not_me`
104
- Then the output should contain "Using takeme (1.0.0)"
105
- Then the output should contain "Using notme (1.0.0)"
106
-
107
- Scenario: skipping a single group to install with the --except flag
108
- Given the cookbook store has the cookbooks:
109
- | takeme | 1.0.0 |
110
- | notme | 1.0.0 |
111
- And I have a Berksfile pointing at the local Berkshelf API with:
112
- """
113
- cookbook 'takeme', group: :take_me
114
- cookbook 'notme', group: :not_me
115
- """
116
- When I successfully run `berks install --except not_me`
117
- Then the output should contain "Using takeme (1.0.0)"
118
- Then the output should not contain "Using notme (1.0.0)"
119
-
120
- Scenario: skipping multiple groups to install with the --except flag
121
- Given the cookbook store has the cookbooks:
122
- | takeme | 1.0.0 |
123
- | notme | 1.0.0 |
124
- And I have a Berksfile pointing at the local Berkshelf API with:
125
- """
126
- cookbook 'takeme', group: :take_me
127
- cookbook 'notme', group: :not_me
128
- """
129
- When I successfully run `berks install --except take_me not_me`
130
- Then the output should not contain "Using takeme (1.0.0)"
131
- Then the output should not contain "Using notme (1.0.0)"
132
-
133
- Scenario: installing a demand from a path location
134
- Given I have a Berksfile pointing at the local Berkshelf API with:
135
- """
136
- cookbook 'example_cookbook', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
137
- """
138
- And the Berkshelf API server's cache is up to date
139
- When I successfully run `berks install`
140
- Then the output should contain:
141
- """
142
- Using example_cookbook (0.5.0) from source at ../../spec/fixtures/cookbooks/example_cookbook-0.5.0
143
- """
144
-
145
- Scenario: installing a demand from a path location with a conflicting constraint
146
- Given I have a Berksfile pointing at the local Berkshelf API with:
147
- """
148
- cookbook 'example_cookbook', '~> 1.0.0', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
149
- """
150
- When I run `berks install`
151
- Then the output should contain:
152
- """
153
- The cookbook downloaded for example_cookbook (~> 1.0.0) did not satisfy the constraint.
154
- """
155
-
156
- Scenario: installing a demand from a path location that also exists in other locations with conflicting dependencies
157
- Given the Chef Server has cookbooks:
158
- | example_cookbook | 0.5.0 | missing_cookbook >= 1.0.0 |
159
- And I have a Berksfile pointing at the local Berkshelf API with:
160
- """
161
- cookbook 'example_cookbook', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
162
- """
163
- And the Berkshelf API server's cache is up to date
164
- When I successfully run `berks install`
165
- Then the output should contain:
166
- """
167
- Using example_cookbook (0.5.0) from source at ../../spec/fixtures/cookbooks/example_cookbook-0.5.0
168
- """
169
-
170
- Scenario: installing a demand from a path location locks the graph to that version
171
- Given the Chef Server has cookbooks:
172
- | other_cookbook | 1.0.0 | example_cookbook ~> 1.0.0 |
173
- And I have a Berksfile pointing at the local Berkshelf API with:
174
- """
175
- cookbook 'example_cookbook', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
176
- cookbook 'other_cookbook'
177
- """
178
- And the Berkshelf API server's cache is up to date
179
- When I run `berks install`
180
- Then the output should contain:
181
- """
182
- Unable to find a solution for demands: example_cookbook (0.5.0), other_cookbook (>= 0.0.0)
183
- """
184
-
185
- Scenario: installing a Berksfile from a remote directory that contains a path location
186
- Given I have a Berksfile at "subdirectory" pointing at the local Berkshelf API with:
187
- """
188
- cookbook 'example_cookbook', path: '../../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
189
- """
190
- When I successfully run `berks install -b subdirectory/Berksfile`
191
- Then the output should contain:
192
- """
193
- Using example_cookbook (0.5.0) from source at ../../../spec/fixtures/cookbooks/example_cookbook-0.5.0
194
- """
195
-
196
- Scenario: installing a demand from a Git location
197
- Given I have a Berksfile pointing at the local Berkshelf API with:
198
- """
199
- cookbook "berkshelf-cookbook-fixture", git: "git://github.com/RiotGames/berkshelf-cookbook-fixture.git"
200
- """
201
- When I successfully run `berks install`
202
- Then the cookbook store should have the git cookbooks:
203
- | berkshelf-cookbook-fixture | 1.0.0 | a97b9447cbd41a5fe58eee2026e48ccb503bd3bc |
204
- And the output should contain:
205
- """
206
- Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at master)
207
- Fetching cookbook index from http://127.0.0.1:26210...
208
- Using berkshelf-cookbook-fixture (1.0.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at master)
209
- """
210
-
211
- Scenario: installing a demand from a Git location that has already been installed
212
- Given I have a Berksfile pointing at the local Berkshelf API with:
213
- """
214
- cookbook "berkshelf-cookbook-fixture", git: "git://github.com/RiotGames/berkshelf-cookbook-fixture.git"
215
- """
216
- And the cookbook store has the git cookbooks:
217
- | berkshelf-cookbook-fixture | 1.0.0 | a97b9447cbd41a5fe58eee2026e48ccb503bd3bc |
218
- When I successfully run `berks install`
219
- Then the output should contain:
220
- """
221
- Using berkshelf-cookbook-fixture (1.0.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at master)
222
- """
223
-
224
- Scenario: installing a Berksfile that contains a Git location with a rel
225
- Given I have a Berksfile pointing at the local Berkshelf API with:
226
- """
227
- cookbook 'berkshelf-cookbook-fixture',
228
- github: 'RiotGames/berkshelf-cookbook-fixture',
229
- branch: 'rel',
230
- rel: 'cookbooks/berkshelf-cookbook-fixture'
231
- """
232
- When I successfully run `berks install`
233
- Then the cookbook store should have the git cookbooks:
234
- | berkshelf-cookbook-fixture | 1.0.0 | 93f5768b7d14df45e10d16c8bf6fe98ba3ff809a |
235
- And the output should contain:
236
- """
237
- Fetching 'berkshelf-cookbook-fixture' from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at rel/cookbooks/berkshelf-cookbook-fixture)
238
- Fetching cookbook index from http://127.0.0.1:26210...
239
- Using berkshelf-cookbook-fixture (1.0.0) from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at rel/cookbooks/berkshelf-cookbook-fixture)
240
- """
241
-
242
- Scenario: installing a Berksfile that contains a Git location
243
- Given I have a Berksfile pointing at the local Berkshelf API with:
244
- """
245
- cookbook 'berkshelf-cookbook-fixture',
246
- git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git',
247
- tag: 'v0.2.0'
248
- """
249
- When I successfully run `berks install`
250
- Then the cookbook store should have the git cookbooks:
251
- | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
252
- And the git cookbook "berkshelf-cookbook-fixture-70a527e17d91f01f031204562460ad1c17f972ee" should not have the following directories:
253
- | .git |
254
-
255
- Scenario: installing a Berksfile that contains a Git location with a tag
256
- Given I have a Berksfile pointing at the local Berkshelf API with:
257
- """
258
- cookbook "berkshelf-cookbook-fixture", git: "git://github.com/RiotGames/berkshelf-cookbook-fixture.git", tag: "v0.2.0"
259
- """
260
- When I successfully run `berks install`
261
- Then the cookbook store should have the git cookbooks:
262
- | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
263
- And the output should contain:
264
- """
265
- Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
266
- Fetching cookbook index from http://127.0.0.1:26210...
267
- Using berkshelf-cookbook-fixture (0.2.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
268
- """
269
-
270
- Scenario: installing a Berksfile that contains a Git location with a ref
271
- Given I have a Berksfile pointing at the local Berkshelf API with:
272
- """
273
- cookbook "berkshelf-cookbook-fixture", git: "git://github.com/RiotGames/berkshelf-cookbook-fixture.git", ref: "70a527e17d91f01f031204562460ad1c17f972ee"
274
- """
275
- When I successfully run `berks install`
276
- Then the cookbook store should have the git cookbooks:
277
- | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
278
- And the output should contain:
279
- """
280
- Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
281
- Fetching cookbook index from http://127.0.0.1:26210...
282
- Using berkshelf-cookbook-fixture (0.2.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
283
- """
284
-
285
- Scenario: installing a Berksfile that contains a Git location with an abbreviated ref
286
- Given I have a Berksfile pointing at the local Berkshelf API with:
287
- """
288
- cookbook "berkshelf-cookbook-fixture", git: "git://github.com/RiotGames/berkshelf-cookbook-fixture.git", ref: "70a527e"
289
- """
290
- When I successfully run `berks install`
291
- Then the cookbook store should have the git cookbooks:
292
- | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
293
- And the output should contain:
294
- """
295
- Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
296
- Fetching cookbook index from http://127.0.0.1:26210...
297
- Using berkshelf-cookbook-fixture (0.2.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at 70a527e)
298
- """
299
-
300
- Scenario: installing a Berksfile that contains a GitHub location
301
- Given I have a Berksfile pointing at the local Berkshelf API with:
302
- """
303
- cookbook "berkshelf-cookbook-fixture", github: "RiotGames/berkshelf-cookbook-fixture", tag: "v0.2.0"
304
- """
305
- When I successfully run `berks install`
306
- Then the cookbook store should have the git cookbooks:
307
- | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
308
- And the output should contain:
309
- """
310
- Fetching 'berkshelf-cookbook-fixture' from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
311
- Fetching cookbook index from http://127.0.0.1:26210...
312
- Using berkshelf-cookbook-fixture (0.2.0) from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
313
- """
314
-
315
- Scenario: installing a Berksfile that contains a GitHub location
316
- Given I have a Berksfile pointing at the local Berkshelf API with:
317
- """
318
- cookbook "berkshelf-cookbook-fixture", github: "RiotGames/berkshelf-cookbook-fixture", tag: "v0.2.0"
319
- """
320
- When I successfully run `berks install`
321
- Then the cookbook store should have the git cookbooks:
322
- | berkshelf-cookbook-fixture | 0.2.0 | 70a527e17d91f01f031204562460ad1c17f972ee |
323
- And the output should contain:
324
- """
325
- Fetching 'berkshelf-cookbook-fixture' from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
326
- Fetching cookbook index from http://127.0.0.1:26210...
327
- Using berkshelf-cookbook-fixture (0.2.0) from https://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
328
- """
329
-
330
- Scenario: running install when current project is a cookbook and the 'metadata' is specified
331
- Given a cookbook named "sparkle_motion"
332
- And I cd to "sparkle_motion"
333
- And I have a Berksfile pointing at the local Berkshelf API with:
334
- """
335
- metadata
336
- """
337
- When I successfully run `berks install`
338
- Then the output should contain:
339
- """
340
- Using sparkle_motion (0.0.0)
341
- """
342
-
343
- Scenario: running install when current project is a cookbook and the 'metadata' is specified with a path
344
- Given a cookbook named "fake"
345
- And I have a Berksfile pointing at the local Berkshelf API with:
346
- """
347
- metadata path: './fake'
348
- """
349
- When I successfully run `berks install`
350
- Then the output should contain:
351
- """
352
- Using fake (0.0.0)
353
- """
354
-
355
- Scenario: running install when a Berksfile.lock is present
356
- Given the Chef Server has cookbooks:
357
- | bacon | 0.1.0 |
358
- | bacon | 0.2.0 |
359
- | bacon | 1.0.0 |
360
- And the Berkshelf API server's cache is up to date
361
- And I have a Berksfile pointing at the local Berkshelf API with:
362
- """
363
- cookbook 'bacon', '~> 0.1'
364
- """
365
- And I write to "Berksfile.lock" with:
366
- """
367
- DEPENDENCIES
368
- bacon (~> 0.1)
369
-
370
- GRAPH
371
- bacon (0.2.0)
372
- """
373
- When I successfully run `berks install`
374
- Then the output should contain:
375
- """
376
- Installing bacon (0.2.0)
377
- """
378
-
379
- Scenario: running install with no Berksfile or Berksfile.lock
380
- When I run `berks install`
381
- Then the output should contain:
382
- """
383
- No Berksfile or Berksfile.lock found at '
384
- """
385
- And the exit status should be "BerksfileNotFound"
386
-
387
- Scenario: running install when the Cookbook is not found on the remote site
388
- Given I have a Berksfile pointing at the local Berkshelf API with:
389
- """
390
- cookbook 'doesntexist'
391
- cookbook 'other-failure'
392
- """
393
- And I run `berks install`
394
- Then the output should contain:
395
- """
396
- Unable to find a solution for demands: doesntexist (>= 0.0.0), other-failure (>= 0.0.0)
397
- """
398
- And the exit status should be "NoSolutionError"
399
-
400
- Scenario: running install when the Cookbook from Berksfile.lock is not found in the sources
401
- Given I have a Berksfile pointing at the local Berkshelf API with:
402
- """
403
- cookbook 'foo'
404
- """
405
- And I write to "Berksfile.lock" with:
406
- """
407
- DEPENDENCIES
408
- foo
409
-
410
- GRAPH
411
- foo (0.1.0)
412
- """
413
- When I run `berks install`
414
- Then the output should contain:
415
- """
416
- Cookbook 'foo' (0.1.0) not found in any of the sources! This can happen if the remote cookbook has been deleted or if the sources inside the Berksfile have changed. Please run `berks update foo` to resolve to a valid version.
417
- """
418
-
419
- Scenario: running install when the version from Berksfile.lock is not found in the sources
420
- Given the Chef Server has cookbooks:
421
- | foo | 0.3.0 |
422
- | foo | 0.2.0 |
423
- And the Berkshelf API server's cache is up to date
424
- And I have a Berksfile pointing at the local Berkshelf API with:
425
- """
426
- cookbook 'foo'
427
- """
428
- And I write to "Berksfile.lock" with:
429
- """
430
- DEPENDENCIES
431
- foo
432
-
433
- GRAPH
434
- foo (0.1.0)
435
- """
436
- When I run `berks install`
437
- Then the output should contain:
438
- """
439
- Cookbook 'foo' (0.1.0) not found in any of the sources! This can happen if the remote cookbook has been deleted or if the sources inside the Berksfile have changed. Please run `berks update foo` to resolve to a valid version.
440
- """
441
-
442
- Scenario: installing when there are sources with duplicate names defined in the same group
443
- Given I have a Berksfile pointing at the local Berkshelf API with:
444
- """
445
- cookbook 'berkshelf-cookbook-fixture'
446
- cookbook 'berkshelf-cookbook-fixture'
447
- """
448
- When I run `berks install`
449
- Then the output should contain:
450
- """
451
- Your Berksfile contains multiple entries named 'berkshelf-cookbook-fixture'. Please remove duplicate dependencies, or put them in different groups.
452
- """
453
- And the exit status should be "DuplicateDependencyDefined"
454
-
455
- Scenario: when a Git demand points to a branch that does not satisfy the version constraint
456
- Given I have a Berksfile pointing at the local Berkshelf API with:
457
- """
458
- cookbook "berkshelf-cookbook-fixture", "1.0.0", git: "git://github.com/RiotGames/berkshelf-cookbook-fixture.git", tag: "v0.2.0"
459
- """
460
- When I run `berks install`
461
- Then the output should contain:
462
- """
463
- Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v0.2.0)
464
- The cookbook downloaded for berkshelf-cookbook-fixture (= 1.0.0) did not satisfy the constraint.
465
- """
466
- And the exit status should be "CookbookValidationFailure"
467
-
468
- Scenario: when a Git demand is defined and a cookbook of the same name and version is already in the cookbook store
469
- Given I have a Berksfile pointing at the local Berkshelf API with:
470
- """
471
- cookbook "berkshelf-cookbook-fixture", git: "git://github.com/RiotGames/berkshelf-cookbook-fixture.git", tag: "v1.0.0"
472
- """
473
- And the cookbook store has the cookbooks:
474
- | berkshelf-cookbook-fixture | 1.0.0 |
475
- When I successfully run `berks install`
476
- Then the output should contain:
477
- """
478
- Fetching 'berkshelf-cookbook-fixture' from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v1.0.0)
479
- Fetching cookbook index from http://127.0.0.1:26210...
480
- Using berkshelf-cookbook-fixture (1.0.0) from git://github.com/RiotGames/berkshelf-cookbook-fixture.git (at v1.0.0)
481
- """
482
-
483
- Scenario: with a git error during download
484
- Given I have a Berksfile pointing at the local Berkshelf API with:
485
- """
486
- cookbook 'berkshelf-cookbook-fixture', '1.0.0'
487
- cookbook "doesntexist", git: "git://github.com/asdjhfkljashflkjashfakljsf"
488
- """
489
- When I run `berks install`
490
- Then the exit status should be "GitError"
491
-
492
- Scenario: transitive dependencies in metadata
493
- Given the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
494
- | bacon | >= 0.0.0 |
495
- And I have a Berksfile pointing at the local Berkshelf API with:
496
- """
497
- metadata
498
- """
499
- And I write to "metadata.rb" with:
500
- """
501
- name "myface"
502
- depends 'fake', '1.0.0'
503
- depends 'bacon', '0.2.0'
504
- """
505
- And the Chef Server has cookbooks:
506
- | bacon | 0.1.0 |
507
- | bacon | 0.2.0 |
508
- | bacon | 1.0.0 |
509
- And the Berkshelf API server's cache is up to date
510
- When I successfully run `berks install`
511
- Then the cookbook store should have the cookbooks:
512
- | bacon | 0.2.0 |
513
- Then the output should contain:
514
- """
515
- Installing bacon (0.2.0)
516
- """
517
-
518
- Scenario: transitive dependencies in metadata when cookbooks are downloaded
519
- Given the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
520
- | bacon | >= 0.0.0 |
521
- And the cookbook store has the cookbooks:
522
- | bacon | 1.0.0 |
523
- | bacon | 0.3.0 |
524
- | bacon | 0.2.0 |
525
- And I have a Berksfile pointing at the local Berkshelf API with:
526
- """
527
- metadata
528
- """
529
- And I write to "metadata.rb" with:
530
- """
531
- name "myface"
532
- depends 'fake', '1.0.0'
533
- depends 'bacon', '0.2.0'
534
- """
535
- When I successfully run `berks install`
536
- Then the output should contain:
537
- """
538
- Using bacon (0.2.0)
539
- """
540
-
541
- Scenario: when asking for the :ruby solver engine without precedence, no error is raised
542
- Given I have a Berksfile pointing at the local Berkshelf API with:
543
- """
544
- cookbook 'example_cookbook', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
545
- solver :ruby
546
- """
547
- When I successfully run `berks install`
548
- Then the output should contain:
549
- """
550
- Resolving cookbook dependencies...
551
- """
552
-
553
- Scenario: when asking for the :gecode solver engine without precedence, no error is raised
554
- Given I have a Berksfile pointing at the local Berkshelf API with:
555
- """
556
- cookbook 'example_cookbook', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
557
- solver :gecode
558
- """
559
- When I successfully run `berks install`
560
- Then the output should contain:
561
- """
562
- Resolving cookbook dependencies...
563
- """
564
-
565
- Scenario: when asking for an unknown solver engine without precedence, no error is raised
566
- Given I have a Berksfile pointing at the local Berkshelf API with:
567
- """
568
- cookbook 'example_cookbook', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
569
- solver :unknown
570
- """
571
- When I successfully run `berks install`
572
- Then the output should contain:
573
- """
574
- Resolving cookbook dependencies...
575
- """
576
-
577
- Scenario: when preferring the :gecode solver engine, no error is raised
578
- Given I have a Berksfile pointing at the local Berkshelf API with:
579
- """
580
- cookbook 'example_cookbook', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
581
- solver :gecode, :preferred
582
- """
583
- When I successfully run `berks install`
584
- Then the output should contain:
585
- """
586
- Resolving cookbook dependencies...
587
- """
588
-
589
- Scenario: when preferring an unknown solver engine, no error is raised
590
- Given I have a Berksfile pointing at the local Berkshelf API with:
591
- """
592
- cookbook 'example_cookbook', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
593
- solver :unknown, :preferred
594
- """
595
- When I successfully run `berks install`
596
- Then the output should contain:
597
- """
598
- Resolving cookbook dependencies...
599
- """
600
-
601
- Scenario: when requiring an unknown solver engine, an error is raised
602
- Given I have a Berksfile pointing at the local Berkshelf API with:
603
- """
604
- cookbook 'example_cookbook', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
605
- solver :unknown, :required
606
- """
607
- When I run `berks install`
608
- Then the output should contain:
609
- """
610
- Engine `unknown` is not supported.
611
- """
612
- And the exit status should be "ArgumentError"
613
-
614
- Scenario: when requiring the :ruby solver engine, no error is raised
615
- Given I have a Berksfile pointing at the local Berkshelf API with:
616
- """
617
- cookbook 'example_cookbook', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
618
- solver :ruby, :required
619
- """
620
- When I successfully run `berks install`
621
- Then the output should contain:
622
- """
623
- Resolving cookbook dependencies...
624
- """
625
-
626
- Scenario: when requiring the :gecode solver engine, no error is raised
627
- Given I have a Berksfile pointing at the local Berkshelf API with:
628
- """
629
- cookbook 'example_cookbook', path: '../../spec/fixtures/cookbooks/example_cookbook-0.5.0'
630
- solver :gecode, :required
631
- """
632
- When I successfully run `berks install`
633
- Then the output should contain:
634
- """
635
- Resolving cookbook dependencies...
636
- """