berkshelf 1.1.6 → 1.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/.cane +4 -0
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +25 -0
  4. data/CONTRIBUTING.md +9 -0
  5. data/Gemfile +1 -7
  6. data/Guardfile +4 -2
  7. data/LICENSE +4 -4
  8. data/README.md +34 -11
  9. data/Thorfile +12 -11
  10. data/berkshelf-complete.sh +68 -0
  11. data/berkshelf.gemspec +23 -10
  12. data/bin/berks +2 -0
  13. data/features/config.feature +5 -4
  14. data/features/configure_command.feature +1 -0
  15. data/features/install_command.feature +7 -43
  16. data/features/step_definitions/configure_cli_steps.rb +6 -0
  17. data/features/step_definitions/filesystem_steps.rb +3 -1
  18. data/features/step_definitions/json_steps.rb +7 -0
  19. data/features/support/env.rb +3 -8
  20. data/features/upload_command.feature +49 -101
  21. data/generator_files/Vagrantfile.erb +1 -1
  22. data/generator_files/gitignore.erb +6 -1
  23. data/lib/berkshelf.rb +17 -26
  24. data/lib/berkshelf/base_generator.rb +8 -7
  25. data/lib/berkshelf/berksfile.rb +33 -13
  26. data/lib/berkshelf/cached_cookbook.rb +16 -37
  27. data/lib/berkshelf/chef.rb +11 -0
  28. data/lib/berkshelf/chef/config.rb +93 -0
  29. data/lib/berkshelf/chef/cookbook.rb +8 -0
  30. data/lib/berkshelf/chef/cookbook/chefignore.rb +60 -0
  31. data/lib/berkshelf/chef/cookbook/metadata.rb +556 -0
  32. data/lib/berkshelf/chef/cookbook/syntax_check.rb +158 -0
  33. data/lib/berkshelf/chef/digester.rb +67 -0
  34. data/lib/berkshelf/cli.rb +18 -4
  35. data/lib/berkshelf/command.rb +117 -0
  36. data/lib/berkshelf/community_rest.rb +135 -0
  37. data/lib/berkshelf/config.rb +16 -50
  38. data/lib/berkshelf/cookbook_generator.rb +5 -9
  39. data/lib/berkshelf/cookbook_source.rb +1 -1
  40. data/lib/berkshelf/cookbook_store.rb +5 -1
  41. data/lib/berkshelf/downloader.rb +4 -4
  42. data/lib/berkshelf/errors.rb +6 -0
  43. data/lib/berkshelf/formatters.rb +3 -3
  44. data/lib/berkshelf/formatters/human_readable.rb +1 -1
  45. data/lib/berkshelf/formatters/json.rb +1 -1
  46. data/lib/berkshelf/git.rb +2 -2
  47. data/lib/berkshelf/init_generator.rb +5 -11
  48. data/lib/berkshelf/location.rb +7 -6
  49. data/lib/berkshelf/locations/chef_api_location.rb +54 -108
  50. data/lib/berkshelf/locations/git_location.rb +1 -1
  51. data/lib/berkshelf/locations/github_location.rb +1 -1
  52. data/lib/berkshelf/locations/path_location.rb +22 -3
  53. data/lib/berkshelf/locations/site_location.rb +31 -99
  54. data/lib/berkshelf/mixin.rb +10 -0
  55. data/lib/berkshelf/mixin/checksum.rb +16 -0
  56. data/lib/berkshelf/mixin/params_validate.rb +218 -0
  57. data/lib/berkshelf/mixin/path_helpers.rb +30 -0
  58. data/lib/berkshelf/mixin/shell_out.rb +23 -0
  59. data/lib/berkshelf/resolver.rb +5 -3
  60. data/lib/berkshelf/ui.rb +5 -1
  61. data/lib/berkshelf/uploader.rb +11 -5
  62. data/lib/berkshelf/vagrant.rb +1 -1
  63. data/lib/berkshelf/vagrant/action/clean.rb +1 -1
  64. data/lib/berkshelf/vagrant/action/install.rb +1 -1
  65. data/lib/berkshelf/vagrant/action/set_ui.rb +2 -2
  66. data/lib/berkshelf/vagrant/action/upload.rb +1 -1
  67. data/lib/berkshelf/vagrant/action/validate.rb +1 -1
  68. data/lib/berkshelf/vagrant/config.rb +1 -1
  69. data/lib/berkshelf/vagrant/middleware.rb +1 -1
  70. data/lib/berkshelf/version.rb +1 -1
  71. data/lib/thor/monkies/shell.rb +8 -0
  72. data/spec/fixtures/cookbooks/example_cookbook-0.5.0/metadata.rb +1 -1
  73. data/spec/fixtures/cookbooks/example_cookbook/metadata.rb +1 -1
  74. data/spec/fixtures/cookbooks/nginx-0.100.5/templates/default/plugins/nginx.rb.erb +1 -1
  75. data/spec/spec_helper.rb +81 -21
  76. data/spec/support/chef_api.rb +29 -28
  77. data/spec/support/knife.rb +2 -2
  78. data/spec/support/test_generators.rb +27 -0
  79. data/spec/unit/berkshelf/berksfile_spec.rb +2 -2
  80. data/spec/unit/berkshelf/cached_cookbook_spec.rb +10 -2
  81. data/spec/unit/berkshelf/community_rest_spec.rb +120 -0
  82. data/spec/unit/berkshelf/config_spec.rb +0 -12
  83. data/spec/unit/berkshelf/cookbook_generator_spec.rb +65 -67
  84. data/spec/unit/berkshelf/cookbook_source_spec.rb +1 -1
  85. data/spec/unit/berkshelf/git_spec.rb +17 -12
  86. data/spec/unit/berkshelf/init_generator_spec.rb +126 -120
  87. data/spec/unit/berkshelf/location_spec.rb +2 -2
  88. data/spec/unit/berkshelf/locations/chef_api_location_spec.rb +90 -186
  89. data/spec/unit/berkshelf/locations/git_location_spec.rb +87 -82
  90. data/spec/unit/berkshelf/locations/path_location_spec.rb +34 -35
  91. data/spec/unit/berkshelf/locations/site_location_spec.rb +12 -115
  92. data/spec/unit/berkshelf/resolver_spec.rb +96 -87
  93. data/spec/unit/berkshelf/ui_spec.rb +132 -0
  94. data/spec/unit/berkshelf/uploader_spec.rb +18 -12
  95. data/spec/unit/chef/config_spec.rb +9 -0
  96. data/spec/unit/chef/cookbook/metadata_spec.rb +5 -0
  97. data/spec/unit/chef/digester_spec.rb +41 -0
  98. metadata +263 -28
data/.cane ADDED
@@ -0,0 +1,4 @@
1
+ --doc-exclude lib/berkshelf/errors.rb
2
+ --max-violations 100
3
+ --style-measure 120
4
+ --parallel
data/.gitignore CHANGED
@@ -21,3 +21,4 @@ tmp
21
21
  /features/config.yml
22
22
  *.sw[op]
23
23
  \.\#*
24
+ rerun.txt
@@ -0,0 +1,25 @@
1
+ # 1.1.0
2
+ ## new/improved commands
3
+ - `berks show` command: display the file path for the given cookbook's current version resolved by your Berksfile
4
+ - `berks list` command: list all of the cookbooks and their versions that are installed by resolving your Berksfile
5
+ - `berks outdated` command (beta): show any cookbooks which have newer versions that are installed by resolving your Berksfile
6
+ - `berks open` command [alpha]: like `berks show` except used to open the cookbook in your configured editor
7
+ alpha: use at your own risk
8
+ - improved `berks upload` command: now takes an optional cookbook name, or names, which will upload the target cookbook(s) to the Chef Server
9
+ - improved `berks update` command: now takes an optional cookbook name, or names, which will update the target cookbook(s) in the Berksfile.lock
10
+
11
+ ## bug fixes
12
+ - Improved error output in Vagrant plugin
13
+ - Stack traces will now be replaced by friendly error messages where possible
14
+ - Fix init generator on Ruby 1.9.2
15
+ - Honor 'chefignore' when vendoring cookbooks this will ensure that you aren't putting junk files into your cookbooks if your distributing them for use with Chef-Solo
16
+
17
+ # 1.0.0
18
+ - Windows support
19
+ - Easier installation by dropping Gecode requirement
20
+ - Vagrant plugin for a seamless iteration process
21
+ - Berkshelf has it's own configuration file
22
+ - `berks configure` command
23
+ - Github source location
24
+ - Improved upload/download speed of cookbooks
25
+ - Lots of bug fixes
@@ -42,3 +42,12 @@ server, so be sure to configure a server safe for this task.
42
42
 
43
43
  See [here](https://github.com/tdegrunt/vagrant-chef-server-bootstrap) for a
44
44
  quick way to get a testing chef server up.
45
+
46
+ ### Debugging Issues
47
+ By default, Berkshelf will only give you the top-level output from a failed command. If you're working deep inside the core, an error like:
48
+
49
+ Berkshelf Error: wrong number of arguments (2 for 1)
50
+
51
+ isn't exactly helpful...
52
+
53
+ Specify the `BERKSHELF_DEBUG` flag when running your command to see a full stack trace and other helpful debugging information.
data/Gemfile CHANGED
@@ -5,12 +5,12 @@ gemspec
5
5
  group :development do
6
6
  gem 'coolline'
7
7
  gem 'guard', '>= 1.5.0'
8
+ gem 'guard-cane'
8
9
  gem 'guard-cucumber'
9
10
  gem 'guard-rspec'
10
11
  gem 'guard-spork'
11
12
  gem 'guard-yard'
12
13
  gem 'redcarpet'
13
- gem 'spork'
14
14
  gem 'yard'
15
15
 
16
16
  require 'rbconfig'
@@ -35,16 +35,10 @@ group :development do
35
35
  end
36
36
 
37
37
  group :test do
38
- gem 'aruba'
39
38
  gem 'fuubar'
40
39
  gem 'json_spec'
41
40
  gem 'rake', '>= 0.9.2.2'
42
41
  gem 'rspec'
43
42
  gem 'thor'
44
- gem 'vcr'
45
43
  gem 'webmock'
46
44
  end
47
-
48
- group :development, :test do
49
- gem 'vagrant', '~> 1.0.6'
50
- end
data/Guardfile CHANGED
@@ -1,5 +1,3 @@
1
- notification :off
2
-
3
1
  guard 'spork' do
4
2
  watch('Gemfile')
5
3
  watch('spec/spec_helper.rb') { :rspec }
@@ -25,3 +23,7 @@ guard 'cucumber', cli: "--drb --format pretty --tags ~@no_run --tags ~@wip", all
25
23
 
26
24
  watch(%r{^lib/berkshelf/cli.rb}) { 'features' }
27
25
  end
26
+
27
+ guard 'cane', run_all_on_start: false do
28
+ watch(/.*\.rb/)
29
+ end
data/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
- Author:: Jamie Winsor (<jamie@vialstudios.com>)
2
- Author:: Josiah Kiehl (<josiah@skirmisher.net>)
3
- Author:: Michael Ivey (<ivey@gweezlebur.com>)
4
- Author:: Justin Campbell (<justin@justincampbell.me>)
1
+ Author:: Jamie Winsor (<reset@riotgames.com>)
2
+ Author:: Josiah Kiehl (<jkiehl@riotgames.com>)
3
+ Author:: Michael Ivey (<michael.ivey@riotgames.com>)
4
+ Author:: Justin Campbell (<justin.campbell@riotgames.com>)
5
5
 
6
6
  Copyright 2012 Riot Games
7
7
 
data/README.md CHANGED
@@ -1,23 +1,46 @@
1
- # Berkshelf
2
- [![Build Status](https://travis-ci.org/RiotGames/berkshelf.png)](https://travis-ci.org/RiotGames/berkshelf)
3
- [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/RiotGames/berkshelf)
1
+ Berkshelf
2
+ =========
3
+ [![Build Status](https://travis-ci.org/RiotGames/berkshelf.png?branch=master)](https://travis-ci.org/RiotGames/berkshelf)
4
+ [![Code Climate](https://codeclimate.com/github/RiotGames/berkshelf.png)](https://codeclimate.com/github/RiotGames/berkshelf)
4
5
 
5
6
  Manage a Cookbook or an Application's Cookbook dependencies
6
7
 
7
- ## Installation
8
+ Installation
9
+ ------------
10
+ Add Berkshelf to your repository's `Gemfile`:
8
11
 
9
- $ gem install berkshelf
12
+ ```ruby
13
+ gem 'berkshelf'
14
+ ```
10
15
 
11
- ## Usage
16
+ Or run it as a standalone:
12
17
 
18
+ gem install berkshelf
19
+
20
+ Usage
21
+ -----
13
22
  See [berkshelf.com](http://berkshelf.com) for up-to-date usage instructions.
14
23
 
15
- # Authors
24
+ Bash Completion
25
+ ---------------
26
+ There is a [berkshelf bash completion script](https://raw.github.com/RiotGames/berkshelf/master/berkshelf-complete.sh). If you're using homebrew, you can install it like this:
27
+
28
+ brew install bash-completion # if you haven't already
29
+
30
+ Download the latest script
31
+
32
+ cd `brew --prefix`/etc/bash_completion && wget https://raw.github.com/RiotGames/berkshelf/master/berkshelf-complete.sh
33
+
34
+ And make sure you have this in your bash/zsh profile:
35
+
36
+ [ -f `brew --prefix`/etc/bash_completion ] && source `brew --prefix`/etc/bash_completion
16
37
 
17
- * Jamie Winsor (<jamie@vialstudios.com>)
18
- * Josiah Kiehl (<josiah@skirmisher.net>)
19
- * Michael Ivey (<ivey@gweezlebur.com>)
20
- * Justin Campbell (<justin@justincampbell.me>)
38
+ Authors
39
+ -------
40
+ - Jamie Winsor (<reset@riotgames.com>)
41
+ - Josiah Kiehl (<jkiehl@riotgames.com>)
42
+ - Michael Ivey (<michael.ivey@riotgames.com>)
43
+ - Justin Campbell (<justin.campbell@riotgames.com>)
21
44
 
22
45
  Thank you to all of our [Contributors](https://github.com/RiotGames/berkshelf/graphs/contributors), testers, and users.
23
46
 
data/Thorfile CHANGED
@@ -38,7 +38,7 @@ class Default < Thor
38
38
 
39
39
  desc "all", "Run all tests"
40
40
  def all
41
- unless run_unit && run_acceptance
41
+ unless run_unit && run_acceptance && run_quality
42
42
  exit 1
43
43
  end
44
44
  end
@@ -46,7 +46,7 @@ class Default < Thor
46
46
  desc "ci", "Run all possible tests on Travis-CI"
47
47
  def ci
48
48
  ENV['CI'] = 'true' # Travis-CI also sets this, but set it here for local testing
49
- unless run_unit("--tag ~chef_server") && run_acceptance("--tags ~@chef_server")
49
+ unless run_unit("--tag ~chef_server") && run_acceptance("--tags ~@chef_server") && run_quality
50
50
  exit 1
51
51
  end
52
52
  end
@@ -65,6 +65,13 @@ class Default < Thor
65
65
  end
66
66
  end
67
67
 
68
+ desc "quality", "Run quality tests"
69
+ def quality
70
+ unless run_quality
71
+ exit 1
72
+ end
73
+ end
74
+
68
75
  no_tasks do
69
76
  def run_unit(*flags)
70
77
  run "rspec --color --format=documentation #{flags.join(' ')} spec"
@@ -73,16 +80,10 @@ class Default < Thor
73
80
  def run_acceptance(*flags)
74
81
  run "cucumber --color --format pretty --tags ~@no_run #{flags.join(' ')}"
75
82
  end
76
- end
77
- end
78
83
 
79
- class VCR < Thor
80
- namespace :vcr
81
- default_task :clean
82
-
83
- desc "clean", "clean VCR cassettes"
84
- def clean
85
- FileUtils.rm_rf("spec/fixtures/vcr_cassettes")
84
+ def run_quality
85
+ run "cane --gte coverage/.last_run.json,90"
86
+ end
86
87
  end
87
88
  end
88
89
  end
@@ -0,0 +1,68 @@
1
+ #!/bin/bash
2
+ #
3
+ # Description
4
+ # Add tab completion for berkshelf
5
+ #
6
+ # Configuration:
7
+ # BERKSHELF_BERKSFILE (default is 'Berksfile')
8
+ #
9
+ # Notes:
10
+ # Must be added to your ~/.bashrc, ~/.zshrc, etc
11
+ #
12
+ # Author:
13
+ # Seth Vargo <sethvargo@gmail.com>
14
+ #
15
+ # License:
16
+ # Apache 2.0
17
+ #
18
+
19
+ _bundler() {
20
+ which bundle > /dev/null 2>&1 && [ -f "$(pwd)/Gemfile" ]
21
+ }
22
+
23
+ # Overwrite berks to use bundler if defined
24
+ _berks() {
25
+ [ _bundler ] && bundle exec berks $@ || berks $@
26
+ }
27
+
28
+ _berkshelf_commands() {
29
+ local cachefile=~/.berkshelf/.commands
30
+ [ ! -f $cachefile ] && $(_berks help | grep berks | cut -d " " -f 4 > $cachefile)
31
+ cat $cachefile
32
+ }
33
+
34
+ _berkshelf_cookbooks() {
35
+ [ -z $BERKSHELF_BERKSFILE ] && BERKSHELF_BERKSFILE="Berksfile"
36
+ cat $BERKSHELF_BERKSFILE | grep "cookbook" | cut -d "'" -f 2
37
+ }
38
+
39
+ _local_cookbooks() {
40
+ ls -d cookbooks/*/ | cut -d "/" -f 2
41
+ }
42
+
43
+ _berkshelf() {
44
+ # local curr prev commands
45
+ COMPREPLY=()
46
+ curr="${COMP_WORDS[COMP_CWORD]}"
47
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
48
+
49
+ # List of commands to complete
50
+ commands=`_berkshelf_commands`
51
+
52
+ case "${prev}" in
53
+ "open"|"outdated"|"show"|"update"|"upload")
54
+ local berkshelf_cookbooks=`_berkshelf_cookbooks`
55
+ local local_cookbooks=`_local_cookbooks`
56
+ local cookbooks=`echo $berkshelf_cookbooks $local_cookbooks | sort -n | uniq`
57
+ COMPREPLY=($(compgen -W "${cookbooks}" -- ${curr}))
58
+ return 0
59
+ ;;
60
+ *)
61
+ ;;
62
+ esac
63
+
64
+ COMPREPLY=($(compgen -W "${commands}" -- ${curr}))
65
+ return 0
66
+ }
67
+
68
+ complete -F _berkshelf berks
@@ -9,10 +9,10 @@ Gem::Specification.new do |s|
9
9
  "Justin Campbell"
10
10
  ]
11
11
  s.email = [
12
- "jamie@vialstudios.com",
13
- "josiah@skirmisher.net",
14
- "ivey@gweezlebur.com",
15
- "justin@justincampbell.me"
12
+ "reset@riotgames.com",
13
+ "jkiehl@riotgames.com",
14
+ "michael.ivey@riotgames.com",
15
+ "justin.campbell@riotgames.com"
16
16
  ]
17
17
 
18
18
  s.description = %q{Manages a Cookbook's, or an Application's, Cookbook dependencies}
@@ -29,17 +29,30 @@ Gem::Specification.new do |s|
29
29
 
30
30
  s.add_dependency 'yajl-ruby'
31
31
  s.add_dependency 'activesupport'
32
- # Must lock 10.16 because of Vagrant 1-0-stable JSON requirement
33
- s.add_dependency 'chef', '= 10.16.2'
34
- s.add_dependency 'ridley', '~> 0.6.3'
35
- s.add_dependency 'chozo', '>= 0.2.3'
32
+ s.add_dependency 'mixlib-shellout'
33
+ s.add_dependency 'mixlib-config'
34
+ s.add_dependency 'faraday', '>= 0.8.5'
35
+ s.add_dependency 'ridley', '>= 0.7.0.rc4'
36
+ s.add_dependency 'chozo', '>= 0.5.0'
36
37
  s.add_dependency 'hashie'
37
38
  s.add_dependency 'minitar'
38
- s.add_dependency 'multi_json', '>= 1.3.0'
39
- s.add_dependency 'solve', '>= 0.4.0.rc1'
39
+ s.add_dependency 'json', '>= 1.5.0'
40
+ s.add_dependency 'multi_json', '~> 1.5'
41
+ s.add_dependency 'solve', '>= 0.4.2'
40
42
  s.add_dependency 'thor', '~> 0.16.0'
41
43
 
42
44
  # Vagrant 1-0-stable compatability locks
43
45
  s.add_dependency 'moneta', '~> 0.6.0'
44
46
  s.add_dependency 'net-ssh-gateway', '= 1.1.0'
47
+
48
+ s.add_development_dependency 'aruba'
49
+ s.add_development_dependency 'cane'
50
+ s.add_development_dependency 'json_spec'
51
+ s.add_development_dependency 'rake', '>= 0.9.2.2'
52
+ s.add_development_dependency 'rspec'
53
+ s.add_development_dependency 'simplecov'
54
+ s.add_development_dependency 'spork'
55
+ s.add_development_dependency 'thor'
56
+ s.add_development_dependency 'webmock'
57
+ s.add_development_dependency 'vagrant', '~> 1.0.6'
45
58
  end
data/bin/berks CHANGED
@@ -6,8 +6,10 @@ begin
6
6
  Berkshelf::Cli.start
7
7
  rescue Berkshelf::BerkshelfError => e
8
8
  Berkshelf.ui.error e
9
+ Berkshelf.ui.error "\t" + e.backtrace.join("\n\t") if ENV['BERKSHELF_DEBUG']
9
10
  exit e.status_code
10
11
  rescue Ridley::Errors::RidleyError => e
11
12
  Berkshelf.ui.error "#{e.class} #{e}"
13
+ Berkshelf.ui.error "\t" + e.backtrace.join("\n\t") if ENV['BERKSHELF_DEBUG']
12
14
  exit 47
13
15
  end
@@ -61,15 +61,16 @@ Feature: cookbook creation with a config file
61
61
  Given I have a Berkshelf config file containing:
62
62
  """
63
63
  {
64
- "vagrant": null
64
+ "vagrant": {
65
+ "vm": {
66
+ "box": 1
67
+ }
68
+ }
65
69
  }
66
70
  """
67
71
  When I run the cookbook command to create "sparkle_motion"
68
72
  Then the output should contain "Invalid configuration"
69
73
  And the output should contain "vagrant.vm.box Expected attribute: 'vagrant.vm.box' to be a type of: 'String'"
70
- And the output should contain "vagrant.vm.box A value is required for attribute: 'vagrant.vm.box'"
71
- And the output should contain "vagrant.vm.box_url Expected attribute: 'vagrant.vm.box_url' to be a type of: 'String'"
72
- And the output should contain "vagrant.vm.box_url A value is required for attribute: 'vagrant.vm.box_url'"
73
74
  And the CLI should exit with the status code for error "InvalidConfiguration"
74
75
 
75
76
  Scenario: creating a new cookbook with a chef client config
@@ -29,6 +29,7 @@ Feature: configure command
29
29
 
30
30
  Scenario: generating a config with default values
31
31
  Given I do not have a Berkshelf config file
32
+ And I have a default Chef config
32
33
  When I run the "configure" command interactively
33
34
  And I type ""
34
35
  And I type ""
@@ -242,9 +242,9 @@ Feature: install cookbooks from a Berksfile
242
242
  When I run `berks install`
243
243
  Then the output should contain:
244
244
  """
245
- A cookbook satisfying 'artifact' (= 0.9.8) not found at git: 'git://github.com/RiotGames/artifact-cookbook.git' with branch: '0.10.0'
245
+ Cookbook downloaded for 'artifact' from git: 'git://github.com/RiotGames/artifact-cookbook.git' with branch: '0.10.0' does not satisfy the version constraint (= 0.9.8)
246
246
  """
247
- And the CLI should exit with the status code for error "ConstraintNotSatisfied"
247
+ And the CLI should exit with the status code for error "CookbookValidationFailure"
248
248
 
249
249
  Scenario: when a git location source is defined and a cookbook of the same name is already cached in the cookbook store
250
250
  Given I write to "Berksfile" with:
@@ -276,17 +276,17 @@ Feature: install cookbooks from a Berksfile
276
276
  Scenario: with a cookbook definition containing a chef_api source location
277
277
  Given I write to "Berksfile" with:
278
278
  """
279
- cookbook "artifact", "= 0.10.2", chef_api: :config
279
+ cookbook "cuke-test", "= 1.0.0", chef_api: :config
280
280
  """
281
281
  And the Chef server has cookbooks:
282
- | artifact | 0.10.2 |
282
+ | cuke-test | 1.0.0 |
283
283
  When I successfully run `berks install`
284
284
  Then the output should contain:
285
285
  """
286
- Installing artifact (0.10.2) from chef_api:
286
+ Installing cuke-test (1.0.0) from chef_api:
287
287
  """
288
288
  And the cookbook store should have the cookbooks:
289
- | artifact | 0.10.2 |
289
+ | cuke-test | 1.0.0 |
290
290
  And the exit status should be 0
291
291
 
292
292
  Scenario: with a chef_api source location specifying :config when a Berkshelf config is not found at the given path
@@ -302,42 +302,6 @@ Feature: install cookbooks from a Berksfile
302
302
  """
303
303
  And the CLI should exit with the status code for error "BerksConfigNotFound"
304
304
 
305
- Scenario: with a chef_api source location specifying a Chef API URL but missing a node_name option
306
- Given I write to "Berksfile" with:
307
- """
308
- cookbook "artifact", chef_api: "https://api.opscode.com/organizations/vialstudios", client_key: "/Users/reset/.chef/knife.rb"
309
- """
310
- When I run `berks install`
311
- Then the output should contain:
312
- """
313
- Source 'artifact' is a 'chef_api' location with a URL for it's value but is missing options: 'node_name'.
314
- """
315
- And the CLI should exit with the status code for error "InvalidChefAPILocation"
316
-
317
- Scenario: with a chef_api source location specifying a Chef API URL but missing a client_key option
318
- Given I write to "Berksfile" with:
319
- """
320
- cookbook "artifact", chef_api: "https://api.opscode.com/organizations/vialstudios", node_name: "reset"
321
- """
322
- When I run `berks install`
323
- Then the output should contain:
324
- """
325
- Source 'artifact' is a 'chef_api' location with a URL for it's value but is missing options: 'client_key'.
326
- """
327
- And the CLI should exit with the status code for error "InvalidChefAPILocation"
328
-
329
- Scenario: with a chef_api source location specifying a Chef API URL but missing a client_key option
330
- Given I write to "Berksfile" with:
331
- """
332
- cookbook "artifact", chef_api: "https://api.opscode.com/organizations/vialstudios"
333
- """
334
- When I run `berks install`
335
- Then the output should contain:
336
- """
337
- Source 'artifact' is a 'chef_api' location with a URL for it's value but is missing options: 'node_name', 'client_key'.
338
- """
339
- And the CLI should exit with the status code for error "InvalidChefAPILocation"
340
-
341
305
  Scenario: with a git error during download
342
306
  Given I write to "Berksfile" with:
343
307
  """
@@ -348,7 +312,7 @@ Feature: install cookbooks from a Berksfile
348
312
  Then the output should contain:
349
313
  """
350
314
  Installing ohai (1.1.4) from site: 'http://cookbooks.opscode.com/api/v1/cookbooks'
351
- Failed to download doesntexist from git: 'git://github.com/asdjhfkljashflkjashfakljsf'
315
+ Failed to download 'doesntexist' from git: 'git://github.com/asdjhfkljashflkjashfakljsf'
352
316
  An error occured during Git execution:
353
317
  """
354
318
  And the CLI should exit with the status code for error "GitError"