Some of my cookbooks are in cookbooks-org folder and some are in cookbooks folder. When I am trying to run the spec, I am getting an error saying cookbook not found for one of the cookbook.
In the below case, cookbook is present in cookbook-org and cookbook1 is present in cookbooks folder and I am getting Chef::Exceptions::CookbookNotFound for cookbook1
describe 'cookbook::default' do
let(:chef_run) do
cookbook_paths = %W(#{File.expand_path(Dir.pwd)}/cookbooks-org #{File.expand_path("..",Dir.pwd)}/cookbooks)
ChefSpec::Runner.new({cookbook_path: cookbook_paths})
end
it 'performs the action' do
chef_run.converge('cookbook::default')
expect(chef_run).to include_recipe('cookbook1::default')
end
end