I’m automating some 3rd party code. What I have is something like:execute ‘refresh’ doonly_if { CONDITION }endexecute ‘reconfigure' doonly_if { ::File.exists?(GUARD) }endSometimes refresh creates GUARD. GUARD could also be created by an admin. reconfigure removes GUARD upon success.I am try to write chefspec tests to cover all the cases:1) no-existing-guard refresh-creates-gaurd2) no-existing-guard refresh-does-not-create-guard3) existing-guard refresh-creates-guard4) existing-guard refresh-does-not-create-guard5) no-existing-guard no-refresh6) exisiting-guard no-refreshWhat I want to do is to “hook” into execute[refresh] and conditionally update the ::File.exists? stub to return true.If I update the stub before the run, I’ve collapsed #1 and #4 into one case.Is it possible to hook into a resource? I tried :step_into but that did not seem to do the trick. Any guidance would be appreciated.Thanks.Joe
Archive powered by MHonArc 2.6.16.