- From: Arnold Krille <
>
- To:
- Subject: [chef] Chefspec link-matcher problem
- Date: Tue, 16 Jul 2013 21:34:45 +0200
Hi,
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
test-case is:
= recipe "munin::plugin_test":
link '/tmp/tmp' do
to '/bin/bash'
action 'create'
end
====
= spec-file:
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'
end
end
====
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,
Arnold
Attachment:
signature.asc
Description: PGP signature
- [chef] Chefspec link-matcher problem, Arnold Krille, 07/16/2013
Archive powered by MHonArc 2.6.16.