- From: Arnold Krille <
>
- To: chef <
>
- Subject: [chef] Mocking ChefSpec to contains recipes?
- Date: Fri, 22 Feb 2013 11:52:16 +0100
Hi all,
I am trying to write chefspec tests for my backuppc-recipes. As this recipe
should be as much self-configuring as possible, the backup client already
detects when the node has (for example) the mysql::server recipe applied and
then installes automysqlbackup and adds the necessary directories to the
paths-to-backup.
That is actually working well, but now I want to write a chefspec for that. I
have:
require 'chefspec'
describe 'backuppc::client' do
it "should add automysqlbackup when mysql-server-cookbook is on the node" do
chef_run = ChefSpec::ChefRunner.new(
:platform => 'ubuntu',
:version => '12.04',
:step_into => ['backuppc_sshkey']
) do |node|
node.set['cpu']['total'] = 1
node.set['recipes'] = ['mysql::server']
end
chef_run.converge 'backuppc::client'
chef_run.should upgrade_package 'automysqlbackup'
end
end
But that test fails. How can I get chefspec/fauxhai to pretend that there are
other recipes already applied to the node?
Have fun,
Arnold
Attachment:
signature.asc
Description: This is a digitally signed message part.
- [chef] Mocking ChefSpec to contains recipes?, Arnold Krille, 02/22/2013
Archive powered by MHonArc 2.6.16.