Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Unable to stub a library method #273
I have looked through the issues but I don't see a specific case like mine for stubbing the library I have created and need a little guidance as I have a feeling Chef is coming in to play here by overwriting my rspec stub.
I have a recipe that has a method
databag = encrypted_data_bag_item('id', 'item')
I have library file in another cookbook that defines this method and then in the recipe I do something like this to make it available to recipes:
I would like to mock the call to encrypted_data_bag_item and return a hashed result. I have tried several approaches but none seem to work. I'm getting this failure before the mock as well
Not sure where the version 0.6.1 is coming from as I am using chefspec 3.0.1
Any help would be much appreciated.