Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't stub Chef::DataBagItem.load by default #12

Merged
merged 5 commits into from
May 6, 2015
Merged

Don't stub Chef::DataBagItem.load by default #12

merged 5 commits into from
May 6, 2015

Conversation

jf647
Copy link
Contributor

@jf647 jf647 commented May 5, 2015

This fixes issue #11 and ensures that you can still stub an unencrypted data bag.

@jf647 jf647 added the bug label May 5, 2015
@jf647 jf647 self-assigned this May 5, 2015
@jf647 jf647 added this to the 0.4.1 milestone May 5, 2015
@jf647 jf647 changed the title Ensure that stubbed data bag items still respond to #raw_data Don't stub Chef::DataBagItem.load by default May 6, 2015
jf647 added a commit that referenced this pull request May 6, 2015
Don't stub Chef::DataBagItem.load by default
@jf647 jf647 merged commit 0f6f68d into master May 6, 2015
@jf647 jf647 deleted the issue_11 branch May 6, 2015 20:36
@mhenrixon
Copy link

Even with this I can't make it work... get errors like

10) db-server::user
     Failure/Error: cached(:chef_run) { converge }
       Double "vault item db_users/casinosaga" received :[] with unexpected arguments
         expected: ("password")
              got: ("id")
        Please stub a default value first if message might be received with other args as well.

@jf647
Copy link
Contributor Author

jf647 commented May 7, 2015

Can you share the recipe that is driving this? We don't stub the 'id' key of the vault item, and I've not run into a recipe that needed it before. It's a simple enough stub to add, but I'd like to understand the use case better before blindly adding it.

@mhenrixon
Copy link

I use it all over the place. Why would you skip the id? Doesn't make sense. Just stub everything in the json. I can't think of a single reason why not

@mhenrixon
Copy link

On second glance it looks like a little something was missing. I added the following to my stubs:

allow(ChefVault::Item).to receive(:load).and_call_original

That seems to do the trick for me.

@jf647 jf647 removed their assignment Nov 24, 2015
@tas50 tas50 added Type: Bug Does not work as expected. and removed bug labels Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants