- From: Joe Nuspl <
>
- To:
- Subject: [chef] Re: Re: Hooking into execute resources in chefspec
- Date: Thu, 30 Oct 2014 11:16:51 -0700
Stubbing of block style guards seems to work for me:
before do allow(File).to receive(:exists?).and_call_original allow(File).to receive(:exists?).with('/tmp/guard').and_return(true) end
But that was not this issue I was describing. I was wondering if there was a way to run some code after the runner processed “execute[refresh]” but before “execute[reconfigure]”.
Joe On Oct 29, 2014, at 4:17 PM, Ranjib Dey <
">
> wrote: chefspec does not allow stubbing block style guards, it does allow command / string style gurards. If you change the guard to use `test -e file` (and from your example, it looks you can) then you use stub_command("test -e file").and_return(true) or false depending upon your use case
|
Archive powered by MHonArc 2.6.16.