after quite some changes to adopt the munin-cookbook to our needs, I am
coming back to checking my stuff with rspec/chefspec.
And especially I want to check that the recipe creates the links for
the munin-plugins as needed (depending on other factors like recipes on
the own node).
But I somehow fail to test that with chefspec. My very minimal
= recipe “munin::plugin_test”:
link ‘/tmp/tmp’ do
describe ‘munin::plugin_test’ do
it “should create a link for a plugin” do
chef_run = ChefSpec::ChefRunner.new()
chef_run.converge 'munin::plugin_test' chef_run.link '/tmp/tmp' chef_run.link '/completely fake'
And altough the last test should be false, chefspec doesn’t complain at
all. I also tried to write it as:
chef_run.should link_to '/tmp/tmp’
but that gives errors that there is no method ‘to’ on ‘link’…
I am using chefspec 1.3.1 and just updated all the local gems (inside
the used rbenv).
What am I doing wrong? Can anyone point me to a working example how to
check filesystem-links with chefspec?
Thanks in advance,