0

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
Robert
  • 10,403
  • 14
  • 67
  • 117
bondy
  • 1
  • Did you confirm that cookbook path is correct? – sethvargo Mar 25 '14 at 15:25
  • This question appears to be off-topic because it is a duplicate of a reported ChefSpec issue: https://github.com/sethvargo/chefspec/issues/65#issuecomment-38535888 – sethvargo Mar 25 '14 at 15:45

0 Answers0