0

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.

brainbuz
  • 384
  • 1
  • 3
  • 12

2 Answers2

1

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.

coderanger
  • 52,400
  • 4
  • 52
  • 75
1

For integration tests check this tutorial about serverspec

For Chef recipes unit testing use ChefSpec

yurinnick
  • 163
  • 4