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,78 +0,0 @@
1
- Feature: berks list
2
- Scenario: When everything is good
3
- Given the cookbook store has the cookbooks:
4
- | fake1 | 1.0.0 |
5
- | fake2 | 1.0.1 |
6
- And I have a Berksfile pointing at the local Berkshelf API with:
7
- """
8
- cookbook 'fake1', '1.0.0'
9
- cookbook 'fake2', '1.0.1'
10
- """
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
- """
21
- When I successfully run `berks list`
22
- Then the output should contain:
23
- """
24
- Cookbooks installed by your Berksfile:
25
- * fake1 (1.0.0)
26
- * fake2 (1.0.1)
27
- """
28
-
29
- Scenario: When the lockfile is not present
30
- Given I have a Berksfile pointing at the local Berkshelf API with:
31
- """
32
- cookbook 'fake', '1.0.0'
33
- """
34
- When I run `berks list`
35
- Then the output should contain:
36
- """
37
- Lockfile not found! Run `berks install` to create the lockfile.
38
- """
39
- And the exit status should be "LockfileNotFound"
40
-
41
- Scenario: When a dependency is not in the lockfile
42
- Given I have a Berksfile pointing at the local Berkshelf API with:
43
- """
44
- cookbook 'fake', '1.0.0'
45
- """
46
- And I write to "Berksfile.lock" with:
47
- """
48
- DEPENDENCIES
49
-
50
- GRAPH
51
- not_fake (1.0.0)
52
- """
53
- When I run `berks list`
54
- Then the output should contain:
55
- """
56
- The lockfile is out of sync! Run `berks install` to sync the lockfile.
57
- """
58
- And the exit status should be "LockfileOutOfSync"
59
-
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`
74
- Then the output should contain:
75
- """
76
- The cookbook 'fake (1.0.0)' is not installed. Please run `berks install` to download and install the missing dependency.
77
- """
78
- And the exit status should be "DependencyNotInstalled"
@@ -1,130 +0,0 @@
1
- Feature: berks outdated
2
- Scenario: the dependency is up to date
3
- Given the Chef Server has cookbooks:
4
- | bacon | 1.0.0 |
5
- | bacon | 1.1.0 |
6
- And the Berkshelf API server's cache is up to date
7
- And the cookbook store has the cookbooks:
8
- | bacon | 1.1.0 |
9
- And I have a Berksfile pointing at the local Berkshelf API with:
10
- """
11
- cookbook 'bacon', '~> 1.1.0'
12
- """
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
-
22
- When I successfully run `berks outdated`
23
- Then the output should contain:
24
- """
25
- All cookbooks up to date!
26
- """
27
-
28
- Scenario: the dependency has no version constraint and there are new items
29
- Given the Chef Server has cookbooks:
30
- | bacon | 1.0.0 |
31
- | bacon | 1.1.0 |
32
- And the Berkshelf API server's cache is up to date
33
- And the cookbook store has the cookbooks:
34
- | bacon | 1.0.0 |
35
- And I have a Berksfile pointing at the local Berkshelf API with:
36
- """
37
- cookbook 'bacon'
38
- """
39
- And I write to "Berksfile.lock" with:
40
- """
41
- DEPENDENCIES
42
- bacon
43
-
44
- GRAPH
45
- bacon (1.0.0)
46
- """
47
- When I successfully run `berks outdated`
48
- Then the output should contain:
49
- """
50
- The following cookbooks have newer versions:
51
- * bacon (1.0.0 => 1.1.0)
52
- """
53
-
54
- Scenario: the dependency has a version constraint and there are new items that satisfy it
55
- Given the Chef Server has cookbooks:
56
- | bacon | 1.1.0 |
57
- | bacon | 1.2.1 |
58
- | bacon | 1.5.8 |
59
- And the Berkshelf API server's cache is up to date
60
- And the cookbook store has the cookbooks:
61
- | bacon | 1.0.0 |
62
- And I have a Berksfile pointing at the local Berkshelf API with:
63
- """
64
- cookbook 'bacon', '~> 1.0'
65
- """
66
- And I write to "Berksfile.lock" with:
67
- """
68
- DEPENDENCIES
69
- bacon (~> 1.0)
70
-
71
- GRAPH
72
- bacon (1.0.0)
73
- """
74
- When I successfully run `berks outdated`
75
- Then the output should contain:
76
- """
77
- The following cookbooks have newer versions:
78
- * bacon (1.0.0 => 1.5.8)
79
- """
80
-
81
- Scenario: When the lockfile is not present
82
- Given I have a Berksfile pointing at the local Berkshelf API with:
83
- """
84
- cookbook 'bacon', '1.0.0'
85
- """
86
- When I run `berks outdated`
87
- Then the output should contain:
88
- """
89
- Lockfile not found! Run `berks install` to create the lockfile.
90
- """
91
- And the exit status should be "LockfileNotFound"
92
-
93
- Scenario: When a dependency is not in the lockfile
94
- Given I have a Berksfile pointing at the local Berkshelf API with:
95
- """
96
- cookbook 'bacon', '1.0.0'
97
- """
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
- """
125
- When I run `berks outdated`
126
- Then the output should contain:
127
- """
128
- The cookbook 'bacon (1.0.0)' is not installed. Please run `berks install` to download and install the missing dependency.
129
- """
130
- And the exit status should be "DependencyNotInstalled"
@@ -1,17 +0,0 @@
1
- @api_server
2
- Feature: berks package
3
- Background:
4
- * the cookbook store has the cookbooks:
5
- | fake | 1.0.0 |
6
-
7
- Scenario: When no options are passed
8
- Given I have a Berksfile pointing at the local Berkshelf API with:
9
- """
10
- cookbook 'fake', '~> 1.0.0'
11
- """
12
- When I successfully run `berks package my-cookbooks.tar.gz`
13
- Then a file named "my-cookbooks.tar.gz" should exist
14
- And the output should contain:
15
- """
16
- Cookbook(s) packaged to
17
- """
@@ -1,17 +0,0 @@
1
- Feature: berks search
2
- Scenario: Searching for a cookbook by name
3
- * I successfully run `berks search berkshelf-cookbook-fixture`
4
- * the output should contain:
5
- """
6
- berkshelf-cookbook-fixture (1.0.0)
7
- """
8
-
9
- Scenario: Searching for a cookbook by partial name
10
- * I successfully run `berks search berkshelf-`
11
- * the results should have the cookbooks:
12
- """
13
- berkshelf-api (1.2.2)
14
- berkshelf-api-server (2.2.0)
15
- berkshelf-cookbook-fixture (1.0.0)
16
- """
17
- * the results should each start with "berkshelf-"
@@ -1,32 +0,0 @@
1
- Feature: berks shelf list
2
- Scenario: With no cookbooks in the store
3
- When I successfully run `berks shelf list`
4
- Then the output should contain:
5
- """
6
- There are no cookbooks in the Berkshelf shelf
7
- """
8
-
9
- Scenario: With two cookbooks in the store
10
- Given the cookbook store has the cookbooks:
11
- | fake | 1.0.0 |
12
- | ekaf | 2.3.4 |
13
- When I successfully run `berks shelf list`
14
- Then the output should contain:
15
- """
16
- Cookbooks in the Berkshelf shelf:
17
- * ekaf (2.3.4)
18
- * fake (1.0.0)
19
- """
20
-
21
- Scenario: With multiple cookbook versions installed
22
- Given the cookbook store has the cookbooks:
23
- | fake | 1.0.0 |
24
- | fake | 1.1.0 |
25
- | fake | 1.2.0 |
26
- | fake | 2.0.0 |
27
- When I successfully run `berks shelf list`
28
- Then the output should contain:
29
- """
30
- Cookbooks in the Berkshelf shelf:
31
- * fake (1.0.0, 1.1.0, 1.2.0, 2.0.0)
32
- """
@@ -1,143 +0,0 @@
1
- Feature: berks shelf show
2
- Scenario: With a cookbook that is not in the store
3
- When I run `berks shelf show fake`
4
- Then the output should contain:
5
- """
6
- Cookbook 'fake' not found in the Berkshelf shelf!
7
- """
8
- And the exit status should be "CookbookNotFound"
9
-
10
- Scenario: With cookbooks in the store
11
- Given the cookbook store has the cookbooks:
12
- | fake | 1.0.0 |
13
- | ekaf | 2.3.4 |
14
- When I successfully run `berks shelf show fake`
15
- Then the output should contain:
16
- """
17
- Displaying all versions of 'fake' in the Berkshelf shelf:
18
- Name: fake
19
- Version: 1.0.0
20
- Description: A fabulous new cookbook
21
- Author: YOUR_COMPANY_NAME
22
- Email: YOUR_EMAIL
23
- License: none
24
- """
25
- And the output should not contain:
26
- """
27
- Name: ekaf
28
- """
29
-
30
- Scenario: With cookbooks in the store and the --version option
31
- Given the cookbook store has the cookbooks:
32
- | fake | 1.0.0 |
33
- | ekaf | 2.3.4 |
34
- When I successfully run `berks shelf show fake --version 1.0.0`
35
- Then the output should contain:
36
- """
37
- Displaying 'fake' (1.0.0) in the Berkshelf shelf:
38
- Name: fake
39
- Version: 1.0.0
40
- Description: A fabulous new cookbook
41
- Author: YOUR_COMPANY_NAME
42
- Email: YOUR_EMAIL
43
- License: none
44
- """
45
- And the output should not contain:
46
- """
47
- Name: ekaf
48
- """
49
-
50
- Scenario: With cookbooks in the store and the --version option doesn't exist
51
- Given the cookbook store has the cookbooks:
52
- | fake | 1.0.0 |
53
- | ekaf | 2.3.4 |
54
- When I run `berks shelf show fake --version 1.2.3`
55
- Then the output should contain:
56
- """
57
- Cookbook 'fake' (1.2.3) not found in the Berkshelf shelf!
58
- """
59
- And the exit status should be "CookbookNotFound"
60
-
61
- Scenario: With multiple cookbook versions installed
62
- Given the cookbook store has the cookbooks:
63
- | fake | 1.0.0 |
64
- | fake | 1.1.0 |
65
- | fake | 1.2.0 |
66
- | fake | 2.0.0 |
67
- When I successfully run `berks shelf show fake`
68
- Then the output should contain:
69
- """
70
- Displaying all versions of 'fake' in the Berkshelf shelf:
71
- Name: fake
72
- Version: 1.0.0
73
- Description: A fabulous new cookbook
74
- Author: YOUR_COMPANY_NAME
75
- Email: YOUR_EMAIL
76
- License: none
77
-
78
- Name: fake
79
- Version: 1.1.0
80
- Description: A fabulous new cookbook
81
- Author: YOUR_COMPANY_NAME
82
- Email: YOUR_EMAIL
83
- License: none
84
-
85
- Name: fake
86
- Version: 1.2.0
87
- Description: A fabulous new cookbook
88
- Author: YOUR_COMPANY_NAME
89
- Email: YOUR_EMAIL
90
- License: none
91
-
92
- Name: fake
93
- Version: 2.0.0
94
- Description: A fabulous new cookbook
95
- Author: YOUR_COMPANY_NAME
96
- Email: YOUR_EMAIL
97
- License: none
98
- """
99
-
100
- Scenario: With multiple cookbook versions installed and the --version flag
101
- Given the cookbook store has the cookbooks:
102
- | fake | 1.0.0 |
103
- | fake | 1.1.0 |
104
- | fake | 1.2.0 |
105
- | fake | 2.0.0 |
106
- When I successfully run `berks shelf show fake --version 1.0.0`
107
- Then the output should contain:
108
- """
109
- Displaying 'fake' (1.0.0) in the Berkshelf shelf:
110
- Name: fake
111
- Version: 1.0.0
112
- Description: A fabulous new cookbook
113
- Author: YOUR_COMPANY_NAME
114
- Email: YOUR_EMAIL
115
- License: none
116
- """
117
- And the output should not contain:
118
- """
119
- Name: fake
120
- Version: 1.1.0
121
- Description: A fabulous new cookbook
122
- Author: YOUR_COMPANY_NAME
123
- Email: YOUR_EMAIL
124
- License: none
125
- """
126
- And the output should not contain:
127
- """
128
- Name: fake
129
- Version: 1.2.0
130
- Description: A fabulous new cookbook
131
- Author: YOUR_COMPANY_NAME
132
- Email: YOUR_EMAIL
133
- License: none
134
- """
135
- And the output should not contain:
136
- """
137
- Name: fake
138
- Version: 2.0.0
139
- Description: A fabulous new cookbook
140
- Author: YOUR_COMPANY_NAME
141
- Email: YOUR_EMAIL
142
- License: none
143
- """
@@ -1,96 +0,0 @@
1
- Feature: berks shelf uninstall
2
- Scenario: With no cookbooks in the store
3
- When I run `berks shelf uninstall fake`
4
- Then the output should contain:
5
- """
6
- Cookbook 'fake' not found in the Berkshelf shelf!
7
- """
8
- And the exit status should be "CookbookNotFound"
9
-
10
- Scenario: With two cookbooks in the store
11
- Given the cookbook store has the cookbooks:
12
- | fake | 1.0.0 |
13
- | ekaf | 2.3.4 |
14
- When I successfully run `berks shelf uninstall fake`
15
- Then the output should contain:
16
- """
17
- Successfully uninstalled fake (1.0.0)
18
- """
19
- And the cookbook store should not have the cookbooks:
20
- | fake | 1.0.0 |
21
- And the cookbook store should have the cookbooks:
22
- | ekaf | 2.3.4 |
23
-
24
- Scenario: With multiple cookbook versions installed
25
- Given the cookbook store has the cookbooks:
26
- | fake | 1.0.0 |
27
- | fake | 1.1.0 |
28
- | fake | 1.2.0 |
29
- | fake | 2.0.0 |
30
- When I successfully run `berks shelf uninstall fake`
31
- Then the output should contain:
32
- """
33
- Successfully uninstalled fake (1.0.0)
34
- Successfully uninstalled fake (1.1.0)
35
- Successfully uninstalled fake (1.2.0)
36
- Successfully uninstalled fake (2.0.0)
37
- """
38
- And the cookbook store should not have the cookbooks:
39
- | fake | 1.0.0 |
40
- | fake | 1.1.0 |
41
- | fake | 1.2.0 |
42
- | fake | 2.0.0 |
43
-
44
- Scenario: When specifying a version
45
- Given the cookbook store has the cookbooks:
46
- | fake | 1.0.0 |
47
- | fake | 1.1.0 |
48
- | fake | 1.2.0 |
49
- | fake | 2.0.0 |
50
- When I successfully run `berks shelf uninstall fake --version 1.0.0`
51
- Then the output should contain:
52
- """
53
- Successfully uninstalled fake (1.0.0)
54
- """
55
- And the cookbook store should not have the cookbooks:
56
- | fake | 1.0.0 |
57
- And the cookbook store should have the cookbooks:
58
- | fake | 1.1.0 |
59
- | fake | 1.2.0 |
60
- | fake | 2.0.0 |
61
-
62
- # FIXME: there seems to be a bug in aruba on windows related to
63
- # interactive stuff that i fully don't understand
64
- @spawn @not-windows
65
- Scenario: With contingencies
66
- Given the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
67
- | ekaf | 2.3.4 |
68
- And the cookbook store has the cookbooks:
69
- | ekaf | 2.3.4 |
70
- When I run `berks shelf uninstall ekaf` interactively
71
- And I type "yes"
72
- Then the output should contain:
73
- """
74
- [fake (1.0.0)] depend on ekaf.
75
-
76
- Are you sure you want to continue? (y/N)
77
- """
78
- And the output should contain:
79
- """
80
- Successfully uninstalled ekaf (2.3.4)
81
- """
82
- And the cookbook store should not have the cookbooks:
83
- | ekaf | 2.3.4 |
84
-
85
- Scenario: With contingencies and the --force flag
86
- Given the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
87
- | ekaf | 2.3.4 |
88
- And the cookbook store has the cookbooks:
89
- | ekaf | 2.3.4 |
90
- When I run `berks shelf uninstall ekaf --force`
91
- Then the output should contain:
92
- """
93
- Successfully uninstalled ekaf (2.3.4)
94
- """
95
- And the cookbook store should not have the cookbooks:
96
- | ekaf | 2.3.4 |
@@ -1,83 +0,0 @@
1
- Feature: berks show
2
- Scenario: With no options
3
- Given the cookbook store has the cookbooks:
4
- | fake | 1.0.0 |
5
- And I have a Berksfile pointing at the local Berkshelf API with:
6
- """
7
- cookbook 'fake', '1.0.0'
8
- """
9
- And I write to "Berksfile.lock" with:
10
- """
11
- DEPENDENCIES
12
- fake (= 1.0.0)
13
-
14
- GRAPH
15
- fake (1.0.0)
16
- """
17
- When I successfully run `berks show fake`
18
- Then the output should contain "cookbooks/fake-1.0.0"
19
-
20
- Scenario: When the parameter is a transitive dependency
21
- Given the cookbook store has the cookbooks:
22
- | dep | 1.0.0 |
23
- And the cookbook store contains a cookbook "fake" "1.0.0" with dependencies:
24
- | dep | ~> 1.0.0 |
25
- And I have a Berksfile pointing at the local Berkshelf API with:
26
- """
27
- cookbook 'fake', '1.0.0'
28
- """
29
- And I write to "Berksfile.lock" with:
30
- """
31
- DEPENDENCIES
32
- fake (= 1.0.0)
33
-
34
- GRAPH
35
- dep (1.0.0)
36
- fake (1.0.0)
37
- dep (~> 1.0.0)
38
- """
39
- And I successfully run `berks install`
40
- When I successfully run `berks show dep`
41
- Then the output should contain "cookbooks/dep-1.0.0"
42
-
43
- Scenario: When the cookbook is not in the Berksfile
44
- Given I have a Berksfile pointing at the local Berkshelf API
45
- When I run `berks show fake`
46
- Then the output should contain:
47
- """
48
- Dependency 'fake' was not found. Please make sure it is in your Berksfile, and then run `berks install` to download and install the missing dependencies.
49
- """
50
- And the exit status should be "DependencyNotFound"
51
-
52
- Scenario: When there is no lockfile present
53
- And I have a Berksfile pointing at the local Berkshelf API with:
54
- """
55
- cookbook 'fake', '1.0.0'
56
- """
57
- When I run `berks show fake`
58
- Then the output should contain:
59
- """
60
- Dependency 'fake' was not found. Please make sure it is in your Berksfile, and then run `berks install` to download and install the missing dependencies.
61
- """
62
- And the exit status should be "DependencyNotFound"
63
-
64
- Scenario: When the cookbook is not installed
65
- Given the cookbook store is empty
66
- And I have a Berksfile pointing at the local Berkshelf API with:
67
- """
68
- cookbook 'fake', '1.0.0'
69
- """
70
- And I write to "Berksfile.lock" with:
71
- """
72
- DEPENDENCIES
73
- fake (= 1.0.0)
74
-
75
- GRAPH
76
- fake (1.0.0)
77
- """
78
- When I run `berks show fake`
79
- Then the output should contain:
80
- """
81
- Cookbook 'fake' (1.0.0) not found in the cookbook store!
82
- """
83
- And the exit status should be "CookbookNotFound"