berkshelf 1.4.6 → 2.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. data/.gitignore +1 -0
  2. data/CHANGELOG.md +1 -5
  3. data/CONTRIBUTING.md +3 -1
  4. data/Gemfile +11 -1
  5. data/README.md +16 -0
  6. data/Thorfile +3 -1
  7. data/berkshelf.gemspec +26 -38
  8. data/features/apply_command.feature +32 -0
  9. data/features/configure_command.feature +31 -0
  10. data/features/contingent_command.feature +5 -5
  11. data/features/default_locations.feature +2 -2
  12. data/features/groups_install.feature +19 -20
  13. data/features/info_command.feature +13 -13
  14. data/features/install_command.feature +86 -83
  15. data/features/json_formatter.feature +60 -23
  16. data/features/list_command.feature +5 -11
  17. data/features/lockfile.feature +286 -6
  18. data/features/open_command.feature +8 -4
  19. data/features/outdated_command.feature +8 -15
  20. data/features/package_command.feature +39 -0
  21. data/features/show_command.feature +8 -9
  22. data/features/step_definitions/chef_server_steps.rb +20 -2
  23. data/features/step_definitions/cli_steps.rb +10 -2
  24. data/features/step_definitions/configure_cli_steps.rb +7 -0
  25. data/features/step_definitions/filesystem_steps.rb +19 -14
  26. data/features/step_definitions/json_steps.rb +22 -5
  27. data/features/step_definitions/utility_steps.rb +13 -1
  28. data/features/support/env.rb +10 -23
  29. data/features/update_command.feature +105 -24
  30. data/features/upload_command.feature +0 -14
  31. data/features/vendor_install.feature +3 -3
  32. data/generator_files/Vagrantfile.erb +11 -11
  33. data/lib/berkshelf.rb +6 -5
  34. data/lib/berkshelf/berksfile.rb +267 -99
  35. data/lib/berkshelf/cli.rb +70 -34
  36. data/lib/berkshelf/cli_commands/test_command.rb +11 -0
  37. data/lib/berkshelf/community_rest.rb +1 -1
  38. data/lib/berkshelf/config.rb +19 -2
  39. data/lib/berkshelf/cookbook_source.rb +41 -12
  40. data/lib/berkshelf/cookbook_store.rb +8 -4
  41. data/lib/berkshelf/errors.rb +61 -29
  42. data/lib/berkshelf/formatters.rb +13 -19
  43. data/lib/berkshelf/formatters/human_readable.rb +8 -0
  44. data/lib/berkshelf/formatters/json.rb +12 -1
  45. data/lib/berkshelf/formatters/null.rb +23 -0
  46. data/lib/berkshelf/init_generator.rb +22 -11
  47. data/lib/berkshelf/location.rb +8 -10
  48. data/lib/berkshelf/locations/chef_api_location.rb +4 -5
  49. data/lib/berkshelf/locations/git_location.rb +14 -12
  50. data/lib/berkshelf/locations/path_location.rb +16 -1
  51. data/lib/berkshelf/locations/site_location.rb +1 -3
  52. data/lib/berkshelf/lockfile.rb +230 -33
  53. data/lib/berkshelf/resolver.rb +2 -1
  54. data/lib/berkshelf/ui.rb +4 -8
  55. data/lib/berkshelf/version.rb +1 -1
  56. data/lib/thor/monkies/shell.rb +2 -5
  57. data/spec/fixtures/cassettes/Berkshelf_Resolver/{ClassMethods/_initialize → _initialize}/adds_the_dependencies_of_the_source_as_sources.yml +0 -0
  58. data/spec/fixtures/cookbooks/example_cookbook/.gitignore +2 -0
  59. data/spec/fixtures/cookbooks/example_cookbook/.kitchen.yml +26 -0
  60. data/spec/fixtures/cookbooks/example_cookbook/Berksfile.lock +5 -0
  61. data/spec/fixtures/lockfiles/default.lock +11 -0
  62. data/spec/{config/knife.rb → knife.rb.sample} +2 -2
  63. data/spec/spec_helper.rb +15 -3
  64. data/spec/support/chef_api.rb +19 -5
  65. data/spec/support/chef_server.rb +4 -3
  66. data/spec/support/knife.rb +18 -0
  67. data/spec/unit/berkshelf/berksfile_spec.rb +332 -235
  68. data/spec/unit/berkshelf/cached_cookbook_spec.rb +40 -42
  69. data/spec/unit/berkshelf/chef/cookbook/chefignore_spec.rb +11 -15
  70. data/spec/unit/berkshelf/community_rest_spec.rb +16 -14
  71. data/spec/unit/berkshelf/config_spec.rb +36 -20
  72. data/spec/unit/berkshelf/cookbook_generator_spec.rb +6 -10
  73. data/spec/unit/berkshelf/cookbook_source_spec.rb +244 -183
  74. data/spec/unit/berkshelf/cookbook_store_spec.rb +72 -76
  75. data/spec/unit/berkshelf/core_ext/file_utils_spec.rb +2 -2
  76. data/spec/unit/berkshelf/downloader_spec.rb +137 -157
  77. data/spec/unit/berkshelf/errors_spec.rb +1 -1
  78. data/spec/unit/berkshelf/formatters/null_spec.rb +17 -0
  79. data/spec/unit/berkshelf/formatters_spec.rb +83 -90
  80. data/spec/unit/berkshelf/git_spec.rb +219 -207
  81. data/spec/unit/berkshelf/init_generator_spec.rb +73 -73
  82. data/spec/unit/berkshelf/location_spec.rb +143 -162
  83. data/spec/unit/berkshelf/locations/chef_api_location_spec.rb +94 -89
  84. data/spec/unit/berkshelf/locations/git_location_spec.rb +75 -59
  85. data/spec/unit/berkshelf/locations/path_location_spec.rb +46 -30
  86. data/spec/unit/berkshelf/locations/site_location_spec.rb +4 -4
  87. data/spec/unit/berkshelf/lockfile_spec.rb +185 -1
  88. data/spec/unit/berkshelf/logger_spec.rb +6 -24
  89. data/spec/unit/berkshelf/mixin/logging_spec.rb +6 -8
  90. data/spec/unit/berkshelf/resolver_spec.rb +36 -38
  91. data/spec/unit/berkshelf/ui_spec.rb +9 -10
  92. data/spec/unit/berkshelf_spec.rb +41 -40
  93. data/spec/unit/chef/config_spec.rb +9 -11
  94. metadata +55 -203
  95. data/spec/config/berkshelf.pem +0 -27
  96. data/spec/config/validator.pem +0 -27
@@ -6,28 +6,53 @@ Feature: --format json
6
6
  Scenario: JSON output installing a cookbook from the default location
7
7
  Given I write to "Berksfile" with:
8
8
  """
9
- cookbook "mysql", "= 1.2.4"
9
+ cookbook 'berkshelf-cookbook-fixture', '1.0.0'
10
+ """
11
+ When I successfully run `berks install --format json`
12
+ Then the output should contain JSON:
13
+ """
14
+ {
15
+ "cookbooks": [
16
+ {
17
+ "version": "1.0.0",
18
+ "location": "site: 'http://cookbooks.opscode.com/api/v1/cookbooks'",
19
+ "name": "berkshelf-cookbook-fixture"
20
+ }
21
+ ],
22
+ "errors": [
23
+
24
+ ],
25
+ "messages": [
26
+
27
+ ]
28
+ }
10
29
  """
11
- When I run the install command with flags:
12
- | --format json |
13
- Then the output should be JSON
14
- And the JSON at "cookbooks" should have 2 cookbooks
15
- And the JSON at "cookbooks/0/version" should be "1.2.4"
16
- And the JSON at "cookbooks/0/location" should be "site: 'http://cookbooks.opscode.com/api/v1/cookbooks'"
17
30
 
18
31
  Scenario: JSON output installing a cookbook we already have
19
32
  Given the cookbook store has the cookbooks:
20
- | mysql | 1.2.4 |
33
+ | berkshelf-cookbook-fixture | 1.0.0 |
21
34
  And I write to "Berksfile" with:
22
35
  """
23
- cookbook "mysql", "= 1.2.4"
36
+ cookbook 'berkshelf-cookbook-fixture', '1.0.0'
37
+ """
38
+ When I successfully run `berks install --format json`
39
+ Then the output should contain JSON:
40
+ """
41
+ {
42
+ "cookbooks": [
43
+ {
44
+ "name": "berkshelf-cookbook-fixture",
45
+ "version": "1.0.0"
46
+ }
47
+ ],
48
+ "errors": [
49
+
50
+ ],
51
+ "messages": [
52
+
53
+ ]
54
+ }
24
55
  """
25
- When I run the install command with flags:
26
- | --format json |
27
- Then the output should be JSON
28
- And the JSON at "cookbooks" should have 1 cookbook
29
- And the JSON at "cookbooks/0/version" should be "1.2.4"
30
- And the JSON should not have "cookbooks/0/location"
31
56
 
32
57
  @chef_server
33
58
  Scenario: JSON output when running the upload command
@@ -35,11 +60,23 @@ Feature: --format json
35
60
  | example_cookbook | example_cookbook-0.5.0 |
36
61
  And the Chef server does not have the cookbooks:
37
62
  | example_cookbook | 0.5.0 |
38
- When I run the upload command with flags:
39
- | --format json |
40
- Then the output should be JSON
41
- And the JSON at "cookbooks" should have 1 cookbook
42
- And the JSON at "cookbooks/0/version" should be "0.5.0"
43
- And the JSON should have "cookbooks/0/uploaded_to"
44
- And the Chef server should have the cookbooks:
45
- | example_cookbook | 0.5.0 |
63
+ When I successfully run `berks upload --format json`
64
+ Then the output should contain JSON:
65
+ """
66
+ {
67
+ "cookbooks": [
68
+ {
69
+ "name": "example_cookbook",
70
+ "version": "0.5.0",
71
+ "location": "path: '<%= File.expand_path(File.join(fixtures_path, 'cookbooks', 'example_cookbook-0.5.0')) %>'",
72
+ "uploaded_to": "http://localhost:4000/"
73
+ }
74
+ ],
75
+ "errors": [
76
+
77
+ ],
78
+ "messages": [
79
+
80
+ ]
81
+ }
82
+ """
@@ -3,23 +3,17 @@ Feature: list command
3
3
  I want a way to show all my cookbooks and their versions without opening my Berksfile
4
4
  So that I can be more productive
5
5
 
6
- @slow_process
7
6
  Scenario: Running the list command
8
7
  Given I write to "Berksfile" with:
9
8
  """
10
- cookbook "build-essential", "1.2.0"
11
- cookbook "chef-client", "1.2.0"
12
- cookbook "mysql", "1.2.4"
13
- cookbook "openssl", "1.0.0"
9
+ cookbook 'berkshelf-cookbook-fixture', '1.0.0'
10
+ cookbook 'hostsfile', '1.0.1'
14
11
  """
15
- And I successfully run `berks install`
16
- When I run `berks list`
12
+ When I successfully run `berks list`
17
13
  Then the output should contain:
18
14
  """
19
15
  Cookbooks installed by your Berksfile:
20
- * build-essential (1.2.0)
21
- * chef-client (1.2.0)
22
- * mysql (1.2.4)
23
- * openssl (1.0.0)
16
+ * berkshelf-cookbook-fixture (1.0.0)
17
+ * hostsfile (1.0.1)
24
18
  """
25
19
  And the exit status should be 0
@@ -3,15 +3,295 @@ Feature: Berksfile.lock
3
3
  I want my versions to be locked even when I don't specify versions in my Berksfile
4
4
  So when I share my repository, all other developers get the same versions that I did when I installed.
5
5
 
6
- @slow_process
7
6
  Scenario: Writing the Berksfile.lock
8
7
  Given I write to "Berksfile" with:
9
8
  """
10
- cookbook 'ntp', '1.1.8'
9
+ site :opscode
10
+ cookbook 'berkshelf-cookbook-fixture', '1.0.0'
11
11
  """
12
- When I run the install command
13
- Then a file named "Berksfile.lock" should exist in the current directory
14
- And the file "Berksfile.lock" should contain in the current directory:
12
+ When I successfully run `berks install`
13
+ Then the file "Berksfile.lock" should contain JSON:
15
14
  """
16
- cookbook 'ntp', :locked_version => '1.1.8'
15
+ {
16
+ "sha":"c6438d7590f4d695d8abae83ff22586ba6d3a52e",
17
+ "sources":{
18
+ "berkshelf-cookbook-fixture":{
19
+ "constraint":"= 1.0.0",
20
+ "locked_version":"1.0.0"
21
+ }
22
+ }
23
+ }
17
24
  """
25
+
26
+ Scenario: Installing a cookbook with dependencies
27
+ Given I write to "Berksfile" with:
28
+ """
29
+ site :opscode
30
+ cookbook 'berkshelf-cookbook-fixture', '1.0.0', github: 'RiotGames/berkshelf-cookbook-fixture', branch: 'deps'
31
+ """
32
+ When I successfully run `berks install`
33
+ Then the file "Berksfile.lock" should contain JSON:
34
+ """
35
+ {
36
+ "sha":"572a911ad3fda64121835ae842141b1d711f71fc",
37
+ "sources":{
38
+ "berkshelf-cookbook-fixture":{
39
+ "constraint":"= 1.0.0",
40
+ "locked_version":"1.0.0",
41
+ "git": "git://github.com/RiotGames/berkshelf-cookbook-fixture.git",
42
+ "ref":"f080e8a74dcb1948780389f45cd2862091f8a0b6"
43
+ },
44
+ "hostsfile":{
45
+ "constraint":"= 1.0.1",
46
+ "locked_version":"1.0.1"
47
+ }
48
+ }
49
+ }
50
+ """
51
+
52
+ Scenario: Writing the Berksfile.lock with a pessimistic lock
53
+ Given I write to "Berksfile" with:
54
+ """
55
+ site :opscode
56
+ cookbook 'berkshelf-cookbook-fixture', '~> 1.0.0'
57
+ """
58
+ And I write to "Berksfile.lock" with:
59
+ """
60
+ {
61
+ "sha":"e42f8e41a5e646bd86591c5b7ec25442736b87fd",
62
+ "sources":{
63
+ "berkshelf-cookbook-fixture":{
64
+ "constraint":"~> 1.0.0",
65
+ "locked_version":"1.0.0"
66
+ }
67
+ }
68
+ }
69
+ """
70
+ When I successfully run `berks install`
71
+ Then the file "Berksfile.lock" should contain JSON:
72
+ """
73
+ {
74
+ "sha":"e42f8e41a5e646bd86591c5b7ec25442736b87fd",
75
+ "sources":{
76
+ "berkshelf-cookbook-fixture":{
77
+ "constraint":"~> 1.0.0",
78
+ "locked_version":"1.0.0"
79
+ }
80
+ }
81
+ }
82
+ """
83
+
84
+ Scenario: Updating with a Berksfile.lock with pessimistic lock
85
+ Given I write to "Berksfile" with:
86
+ """
87
+ site :opscode
88
+ cookbook 'berkshelf-cookbook-fixture', '~> 0.1'
89
+ """
90
+ And I write to "Berksfile.lock" with:
91
+ """
92
+ {
93
+ "sha":"3dced4fcd9c3f72b68e746190aaa1140bdc6cc3d",
94
+ "sources":{
95
+ "berkshelf-cookbook-fixture":{
96
+ "constraint":"~> 0.1",
97
+ "locked_version":"0.1.0"
98
+ }
99
+ }
100
+ }
101
+ """
102
+ When I successfully run `berks update berkshelf-cookbook-fixture`
103
+ Then the file "Berksfile.lock" should contain JSON:
104
+ """
105
+ {
106
+ "sha":"b2714a4f9bdf500cb20267067160a0b3c1d8404c",
107
+ "sources":{
108
+ "berkshelf-cookbook-fixture":{
109
+ "constraint":"~> 0.1",
110
+ "locked_version":"0.2.0"
111
+ }
112
+ }
113
+ }
114
+ """
115
+
116
+ Scenario: Updating with a Berksfile.lock with hard lock
117
+ Given I write to "Berksfile" with:
118
+ """
119
+ site :opscode
120
+ cookbook 'berkshelf-cookbook-fixture', '1.0.0'
121
+ """
122
+ And I write to "Berksfile.lock" with:
123
+ """
124
+ {
125
+ "sha":"7d07c22eca03bf6da5aaf38ae81cb9a8a439c692",
126
+ "sources":{
127
+ "berkshelf-cookbook-fixture":{
128
+ "constraint":"= 1.0.0",
129
+ "locked_version":"1.0.0"
130
+ }
131
+ }
132
+ }
133
+ """
134
+ When I successfully run `berks update berkshelf-cookbook-fixture`
135
+ Then the file "Berksfile.lock" should contain JSON:
136
+ """
137
+ {
138
+ "sha":"c6438d7590f4d695d8abae83ff22586ba6d3a52e",
139
+ "sources":{
140
+ "berkshelf-cookbook-fixture":{
141
+ "constraint":"= 1.0.0",
142
+ "locked_version":"1.0.0"
143
+ }
144
+ }
145
+ }
146
+ """
147
+
148
+ Scenario: Updating a Berksfile.lock with a git location
149
+ Given I write to "Berksfile" with:
150
+ """
151
+ site :opscode
152
+ cookbook 'berkshelf-cookbook-fixture', git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git', ref: '919afa0c4'
153
+ """
154
+ When I successfully run `berks install`
155
+ Then the file "Berksfile.lock" should contain JSON:
156
+ """
157
+ {
158
+ "sha": "b8e06c891c824b3e3481df024eb241e1c02572a6",
159
+ "sources":{
160
+ "berkshelf-cookbook-fixture":{
161
+ "git":"git://github.com/RiotGames/berkshelf-cookbook-fixture.git",
162
+ "ref":"919afa0c402089df23ebdf36637f12271b8a96b4",
163
+ "locked_version":"1.0.0"
164
+ }
165
+ }
166
+ }
167
+ """
168
+
169
+ Scenario: Updating a Berksfile.lock with a git location and a branch
170
+ Given I write to "Berksfile" with:
171
+ """
172
+ site :opscode
173
+ cookbook 'berkshelf-cookbook-fixture', git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git', branch: 'master'
174
+ """
175
+ When I successfully run `berks install`
176
+ Then the file "Berksfile.lock" should contain JSON:
177
+ """
178
+ {
179
+ "sha": "310f95bb86ba76b47eef28abc621d0e8de19bbb6",
180
+ "sources":{
181
+ "berkshelf-cookbook-fixture":{
182
+ "git":"git://github.com/RiotGames/berkshelf-cookbook-fixture.git",
183
+ "ref":"a97b9447cbd41a5fe58eee2026e48ccb503bd3bc",
184
+ "locked_version":"1.0.0"
185
+ }
186
+ }
187
+ }
188
+ """
189
+
190
+ Scenario: Updating a Berksfile.lock with a git location and a branch
191
+ Given I write to "Berksfile" with:
192
+ """
193
+ site :opscode
194
+ cookbook 'berkshelf-cookbook-fixture', git: 'git://github.com/RiotGames/berkshelf-cookbook-fixture.git', tag: 'v0.2.0'
195
+ """
196
+ When I successfully run `berks install`
197
+ Then the file "Berksfile.lock" should contain JSON:
198
+ """
199
+ {
200
+ "sha": "ade51e222f569cc299f34ec1100d321f3b230c36",
201
+ "sources":{
202
+ "berkshelf-cookbook-fixture":{
203
+ "git":"git://github.com/RiotGames/berkshelf-cookbook-fixture.git",
204
+ "ref":"70a527e17d91f01f031204562460ad1c17f972ee",
205
+ "locked_version":"0.2.0"
206
+ }
207
+ }
208
+ }
209
+ """
210
+
211
+ Scenario: Updating a Berksfile.lock with a GitHub location
212
+ Given I write to "Berksfile" with:
213
+ """
214
+ site :opscode
215
+ cookbook 'berkshelf-cookbook-fixture', github: 'RiotGames/berkshelf-cookbook-fixture', ref: '919afa0c4'
216
+ """
217
+ When I successfully run `berks install`
218
+ Then the file "Berksfile.lock" should contain JSON:
219
+ """
220
+ {
221
+ "sha": "3ac97aa503bcebb2b393410aebc176c3c5bed2d4",
222
+ "sources":{
223
+ "berkshelf-cookbook-fixture":{
224
+ "git":"git://github.com/RiotGames/berkshelf-cookbook-fixture.git",
225
+ "ref":"919afa0c402089df23ebdf36637f12271b8a96b4",
226
+ "locked_version":"1.0.0"
227
+ }
228
+ }
229
+ }
230
+ """
231
+
232
+ Scenario: Updating a Berksfile.lock with a path location
233
+ Given I write to "Berksfile" with:
234
+ """
235
+ site :opscode
236
+ cookbook 'fake', path: './fake'
237
+ """
238
+ And a cookbook named "fake"
239
+ When I successfully run `berks install`
240
+ Then the file "Berksfile.lock" should contain JSON:
241
+ """
242
+ {
243
+ "sha": "42a13f91f1ba19ce8c6776fe267e74510dee27ce",
244
+ "sources":{
245
+ "fake":{
246
+ "path":"./fake",
247
+ "locked_version":"0.0.0"
248
+ }
249
+ }
250
+ }
251
+ """
252
+
253
+ Scenario: Updating a Berksfile.lock with a different site location
254
+ Given pending we have a reliable non-opscode site to test
255
+ # Given I write to "Berksfile" with:
256
+ # """
257
+ # cookbook 'fake', site: 'example.com'
258
+ # """
259
+ # When I successfully run `berks install`
260
+ # Then the file "Berksfile.lock" should contain JSON:
261
+ # """
262
+ # {
263
+ # "sha": "3232c5ae6f54aee3efc5fdcfce69249a2526822b",
264
+ # "sources":{
265
+ # "sudo":{
266
+ # "site":"opscode",
267
+ # "locked_version":"2.0.4"
268
+ # }
269
+ # }
270
+ # }
271
+ # """
272
+
273
+ Scenario: Installing when the locked version is no longer satisfied
274
+ Given I write to "Berksfile" with:
275
+ """
276
+ site :opscode
277
+ cookbook 'berkshelf-cookbook-fixture', '1.0.0'
278
+ """
279
+ And I successfully run `berks install`
280
+ And I write to "Berksfile" with:
281
+ """
282
+ site :opscode
283
+ cookbook 'berkshelf-cookbook-fixture', '~> 1.3.0'
284
+ """
285
+ When I run `berks install`
286
+ Then the output should contain:
287
+ """
288
+ Berkshelf could not find compatible versions for cookbook 'berkshelf-cookbook-fixture':
289
+ In Berksfile:
290
+ berkshelf-cookbook-fixture (1.0.0)
291
+
292
+ In Berksfile.lock:
293
+ berkshelf-cookbook-fixture (~> 1.3.0)
294
+
295
+ Try running `berks update berkshelf-cookbook-fixture, which will try to find 'berkshelf-cookbook-fixture' matching '~> 1.3.0'.
296
+ """
297
+ And the CLI should exit with the status code for error "OutdatedCookbookSource"
@@ -4,21 +4,24 @@ Feature: open command
4
4
  So that I can troubleshoot bugs in my dependencies
5
5
 
6
6
  Scenario: Running berks open with no $EDITOR
7
- Given the environment variable EDITOR is nil
7
+ Given the BERKSHELF_EDITOR and VISUAL environment variables are not set
8
+ And the environment variable EDITOR is nil
8
9
  And the cookbook store has the cookbooks:
9
10
  | mysql | 1.2.4 |
10
11
  When I run `berks open mysql`
11
12
  Then the output should contain "To open a cookbook, set $EDITOR or $BERKSHELF_EDITOR"
12
13
 
13
14
  Scenario: Running berks open with an $EDITOR
14
- Given the environment variable EDITOR is "ls"
15
+ Given the BERKSHELF_EDITOR and VISUAL environment variables are not set
16
+ And the environment variable EDITOR is "ls"
15
17
  And the cookbook store has the cookbooks:
16
18
  | mysql | 1.2.4 |
17
19
  When I run `berks open mysql`
18
20
  Then the output should contain "metadata.rb"
19
21
 
20
22
  Scenario: Running berks open with a missing EDITOR
21
- Given the environment variable EDITOR is "wat"
23
+ Given the BERKSHELF_EDITOR and VISUAL environment variables are not set
24
+ And the environment variable EDITOR is "wat"
22
25
  And the cookbook store has the cookbooks:
23
26
  | mysql | 1.2.4 |
24
27
  When I run `berks open mysql`
@@ -26,7 +29,8 @@ Feature: open command
26
29
  And the CLI should exit with the status code for error "CommandUnsuccessful"
27
30
 
28
31
  Scenario: Running berks open when the cookbook does not exist
29
- Given the environment variable EDITOR is "ls"
32
+ Given the BERKSHELF_EDITOR and VISUAL environment variables are not set
33
+ And the environment variable EDITOR is "ls"
30
34
  When I run `berks open mysql`
31
35
  Then the output should contain "Cookbook 'mysql' not found in any of the sources!"
32
36
  And the CLI should exit with the status code for error "CookbookNotFound"