Works:
mkdir cookbooks
cd cookbooks/
git clone git://github.com/mlafeldt/ps2dev-cookbook.git ps2dev
git clone git://github.com/opscode-cookbooks/build-essential.git
git clone git://github.com/opscode-cookbooks/git.git
rspec .
The recipe ps2dev::default
should install wget
should execute toolchain-sudo.sh
should delete directory /tmp/toolchain
should create cookbook file /etc/profile.d/ps2dev.sh
Finished in 0.04716 seconds
4 examples, 0 failures
Doesn't work:
git clone git://github.com/mlafeldt/ps2dev-cookbook.git
cd ps2dev-cookbook/
rspec .
The recipe ps2dev::default
[2012-09-17T11:05:03+02:00] WARN: found a directory pulse-PKdhtXMmr18n in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory sni-qt_keepassx_2763-XomMBl in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory cookbooks in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory orbit-mlafeldt in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory pulse-2L9K88eMlGn7 in the cookbook path, but it contains no cookbook files. skipping.
should install wget (FAILED - 1)
[2012-09-17T11:05:03+02:00] WARN: found a directory pulse-PKdhtXMmr18n in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory sni-qt_keepassx_2763-XomMBl in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory cookbooks in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory orbit-mlafeldt in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory pulse-2L9K88eMlGn7 in the cookbook path, but it contains no cookbook files. skipping.
should execute toolchain-sudo.sh (FAILED - 2)
[2012-09-17T11:05:03+02:00] WARN: found a directory pulse-PKdhtXMmr18n in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory sni-qt_keepassx_2763-XomMBl in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory cookbooks in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory orbit-mlafeldt in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory pulse-2L9K88eMlGn7 in the cookbook path, but it contains no cookbook files. skipping.
should delete directory /tmp/toolchain (FAILED - 3)
[2012-09-17T11:05:03+02:00] WARN: found a directory pulse-PKdhtXMmr18n in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory sni-qt_keepassx_2763-XomMBl in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory cookbooks in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory orbit-mlafeldt in the cookbook path, but it contains no cookbook files. skipping.
[2012-09-17T11:05:03+02:00] WARN: found a directory pulse-2L9K88eMlGn7 in the cookbook path, but it contains no cookbook files. skipping.
should create cookbook file /etc/profile.d/ps2dev.sh (FAILED - 4)
Failures:
1) The recipe ps2dev::default should install wget
Failure/Error: let (:chef_run) { ChefSpec::ChefRunner.new.converge 'ps2dev::default' }
Chef::Exceptions::CookbookNotFound:
Cookbook ps2dev not found. If you're loading ps2dev from another cookbook, make sure you configure the dependency in your metadata
# ./spec/default_spec.rb:4:in `block (2 levels) in <top (required)>'
# ./spec/default_spec.rb:8:in `block (3 levels) in <top (required)>'
2) The recipe ps2dev::default should execute toolchain-sudo.sh
Failure/Error: let (:chef_run) { ChefSpec::ChefRunner.new.converge 'ps2dev::default' }
Chef::Exceptions::CookbookNotFound:
Cookbook ps2dev not found. If you're loading ps2dev from another cookbook, make sure you configure the dependency in your metadata
# ./spec/default_spec.rb:4:in `block (2 levels) in <top (required)>'
# ./spec/default_spec.rb:13:in `block (2 levels) in <top (required)>'
3) The recipe ps2dev::default should delete directory /tmp/toolchain
Failure/Error: let (:chef_run) { ChefSpec::ChefRunner.new.converge 'ps2dev::default' }
Chef::Exceptions::CookbookNotFound:
Cookbook ps2dev not found. If you're loading ps2dev from another cookbook, make sure you configure the dependency in your metadata
# ./spec/default_spec.rb:4:in `block (2 levels) in <top (required)>'
# ./spec/default_spec.rb:17:in `block (2 levels) in <top (required)>'
4) The recipe ps2dev::default should create cookbook file /etc/profile.d/ps2dev.sh
Failure/Error: let (:chef_run) { ChefSpec::ChefRunner.new.converge 'ps2dev::default' }
Chef::Exceptions::CookbookNotFound:
Cookbook ps2dev not found. If you're loading ps2dev from another cookbook, make sure you configure the dependency in your metadata
# ./spec/default_spec.rb:4:in `block (2 levels) in <top (required)>'
# ./spec/default_spec.rb:21:in `block (2 levels) in <top (required)>'
Finished in 0.01191 seconds
4 examples, 4 failures
Failed examples:
rspec ./spec/default_spec.rb:7 # The recipe ps2dev::default should install wget
rspec ./spec/default_spec.rb:12 # The recipe ps2dev::default should execute toolchain-sudo.sh
rspec ./spec/default_spec.rb:16 # The recipe ps2dev::default should delete directory /tmp/toolchain
rspec ./spec/default_spec.rb:20 # The recipe ps2dev::default should create cookbook file /etc/profile.d/ps2dev.sh
Hi Mathias,
You could stub out
include_recipe
if you wanted to test the cookbook in isolation. Before the converge:You'll still need to rename the cookbook directory because of the way chef-solo works, there's a related issue that goes into more detail here:
chefspec/chefspec#24
It's common for people to use librarian-chef or berkshelf to pull in cookbook dependencies.
You could also avoid using
include_recipe
and instead refer to the recipe from a role.Cheers,
Andrew.