0

I am trying to create a unit test using chefspec, but I can not find the correct way. Here is the piece of chef code

def printMessage(message)
    log 'Debuggin' do
       message "#{message}"
       level :info
       action :write
    end
end

My question is, what is the correct way to test that chef cookbook method?

1 Answers1

0

The most common way is to not test it directly, just test the recipes you use it in as per normal. For testing it directly, it would depend on how you're patching things in to the DSL.

coderanger
  • 52,400
  • 4
  • 52
  • 75