You’re correct, I am trying to run it on my own machine.
I’m definitely going to have a look into Test Kitchen (it’s in my to-learn list), but I was trying to start small to learn incrementally. I can write simple cookbooks, LWRPs, etc, and TDD is my current step.
What’s the best approach to running chefspec inside the Vagrant VM?
- vagrant ssh
- cd /vagrant
But that’s not very CI-friendly. Is there some less manual way?
On Monday, November 19, 2012 at 12:21, Jamie Winsor wrote:
It looks like you’re attempting to test on your own machine - this will be a problem. We generally use Vagrant virtual machines to test our cookbooks.
The reason your cookbook is not found is because the cookbook_path attribute in your machines Knife config does not contain the path to the cookbook you are testing.
Berkshelf will automatically make the cookbooks acailable to your Vagrant VM so you could run your specs within the Vagrant VM.
There is also the Test-Kitchen approach which I would recommend you looking into!
On Nov 19, 2012, at 5:53 AM, Cassiano Leal <firstname.lastname@example.org (mailto:email@example.com)> wrote:
I’m trying to TDD a cookbook for my company’s website. I’m using Berksfile to manage cookbook dependencies and I’m trying to get Chefspec to work.
Converging the cookbook on a VM works just fine, but when I run rspec I get a Cookbook not found error.
There’s additional information on this gist: https://gist.github.com/4072082
Do I need to require something from berkshelf in the specs? I tried including require ‘berkshelf’ at the top of the recipe to no avail.
Appreciate your thoughts/guidance.