This problem arises when you:
- Write a library cookbook (i.e. it has no recipes apart from a no-op default.rb)
- Create a
test
cookbook undertest/fixtures/cookbooks/
to exercise the library. That istest/fixtures/cookbooks/test/recipes/system.rb
- Write a ChefSpec spec that
describe 'test::system'
- Use Policyfiles rather than Berkshelf.
When using Berkshelf you would use group :integration do ... end
to include the test cookbook only when running tests.
How do you write a Policyfile that only references the test cookbook when running tests?
Right now I have my policyfile always packaging the test cookbook. Not ideal but acceptable to get something that just works in a test environment. Not sustainable over the longer term.
Appreciate any hints, tips or incantations.