Closed rnelson0 closed 8 months ago
@rnelson0 From what I can tell it seems likely that the issue has arisen from a change in the rspec version that is being brought in. Could you compare the version that is installed prior the the update and the version that is installed after and see what changes are listed as having happened between them. This brings to mind an issue we had had ourselves with the way in which stubs work.
@david22swan It's been a while since I reported this but it wasn't really related to the PDK and has been resolved.
Describe the bug When updating pdk-templates to 2.6.1 or newer (including the most recent 2.7.1 update), our mock for the function vault_lookup() throws errors during unit testing. We have made no other changes other than
pdk update
, and using PDK 2.7.1 with pdk-templates 2.5.0 works fine, it is tied to the update of pdk-templates.To Reproduce On a repo with pdk-templates v2.5.0 and a mocked function, run
pdk update
to 2.6.1 or newer, then runpdk test unit
again.Expected behavior The tests would continue to behave the same way, pass or fail, as they did with the old pdk templates, and not generate failures based on the function.
Additional context
pdk --version
) - 2.7.1The mocked function is defined in
spec/spec_helper_local.rb
:Running
pdk test unit
after thepdk update
results in this error over and over:We have tried changing the code to
f.stub
,f.stubs
, and a few other permutations I've forgotten now and receive the same errors every time. Are we mocking the function incorrectly, or is there some other issue going on? We are quite happy to change the mock rather than anything else, as long as it allows unit tests to function properly. Thank you!