brainbuz
brainbuz

Reputation: 444

Writing rspec tests for Chef test kitchen

I'm learning chef and working with kitchen. From the documentation I was able to figure out how to run bats tests, but I can't find any explanation on writing rspec tests other than that it is one of the four built in test suites.

Upvotes: 0

Views: 1399

Answers (2)

yurinnick
yurinnick

Reputation: 193

For integration tests check this tutorial about serverspec

For Chef recipes unit testing use ChefSpec

Upvotes: 1

coderanger
coderanger

Reputation: 54249

Just put your serverspec code under test/integration/<suite name>/serverspec/<suite name>_spec.rb. Make sure you load serverspec by putting this at the top of your file:

require 'serverspec'
set :backend, :exec

Other than that, just write normal serverspec test code.

Upvotes: 1

Related Questions