I’m automating some 3rd party code. What I have is something like:
Sometimes 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-gaurd 2) no-existing-guard refresh-does-not-create-guard 3) existing-guard refresh-creates-guard 4) existing-guard refresh-does-not-create-guard 5) no-existing-guard no-refresh 6) exisiting-guard no-refresh What 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.